- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Greetings,
Please consider the following code which generates a runtime error in IFX 2023.0.0 but not in Classic. Can this be fixed for the next point release?
! Compiles and runs with with Classic:
! Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on
! Intel(R) 64, Version 2021.8.0 Build 20221119_000000
!
! Compiles but generates run time errors with IFX:
! Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version
! 2023.0.0 Build 20221201
! forrtl: severe (153): allocatable array or pointer is not allocated
!***********************************************************************
module mymod_m
implicit none
type mytype
character(:), allocatable :: links
end type mytype
type(mytype), target :: sd
contains
!*******************************************************************************
subroutine update(fdir)
character(len=*), intent(in) :: fdir
print *, "fdir in update: "//trim(fdir)
sd%links = fdir
end subroutine update
!*******************************************************************************
function fixdir() result(fdir)
character(:), allocatable :: fdir
fdir = 'stuff'
call update(fdir)
print *, "fdir in fixdir: ", fdir
end function fixdir
end module mymod_m
!*******************************************************************************
program allocate_error
use mymod_m
implicit none
sd%links = fixdir()
end program allocate_error
Thanks,
Dave
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
it runs and you get the correct answer in ifx, but for some strange reason it throws the error on exiting line 44 it appears. Watch shows the correct value on entry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It certainly would not win prizes for good coding practice but I would be interested in some comment of the legality. I would expect the fixdir function on the RHS to fully complete before sd%links updates on the LHS but fixdir changes sd%links during it execution so sd%links gets updated twice.....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's good to see so many people using ifx! Thanks for reporting this issue.
It fails on Linux at line 44, too.
I filed a bug, CMPLRLLVM-45010. I'll let you know about the fix.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You're welcome! Thanks for accepting this as a bug. I'm planning on looking at ifx releases as they come out. There's been some great progress in the last year.
I'll follow this thread and watch for a resolution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I checked with the resident Intel Fortran standards expert. He says it is legal Fortran.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for checking on this. I thought it was legal, though I agree with @andrew_4619 that it's not the best coding practice.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@fortrandave, the runtime error is gone with ifx 2024.0.0 that was released this week. Another one fixed for you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks again! I'll verify on my side once I get my hands on 2024.0. Corporate environments take a bit longer to process things.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Corporates latest idea for transport, the emissions plots are spectacular, the company will be fully green.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No kidding. Thanks for a good laugh! I'm hoping to have it in hand not too long after our Thanksgiving break.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page