- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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
Lien copié
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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.....
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
I checked with the resident Intel Fortran standards expert. He says it is legal Fortran.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Thanks for checking on this. I thought it was legal, though I agree with @andrew_4619 that it's not the best coding practice.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
@fortrandave, the runtime error is gone with ifx 2024.0.0 that was released this week. Another one fixed for you!
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Corporates latest idea for transport, the emissions plots are spectacular, the company will be fully green.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
No kidding. Thanks for a good laugh! I'm hoping to have it in hand not too long after our Thanksgiving break.
- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable