Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

COMPILER BUG: object destructors

DataScientist
Valued Contributor I
979 Views

There is a discussion of a potential bug in the Intel ifort compiler on this GitHub page that I wanted to bring to the attention of the Intel team. There is no point in reproducing the discussion here as it is already extensively discussed on the referenced GitHub page.

0 Kudos
1 Solution
Barbara_P_Intel
Moderator
923 Views

Thanks for reporting this. Our Fortran developer team agrees it is a bug. I filed a bug report, CMPLRIL0-34256. I'll post here when it is fixed and available.



View solution in original post

6 Replies
Barbara_P_Intel
Moderator
924 Views

Thanks for reporting this. Our Fortran developer team agrees it is a bug. I filed a bug report, CMPLRIL0-34256. I'll post here when it is fixed and available.



FortranFan
Honored Contributor II
877 Views

@Barbara_P_Intel ,

Please see my comments at that link and the additional example therein.  As I imply in them, I'm more than open to being proven entirely wrong on this but I do not think there is a bug given how the standard is worded.  The important thing is that a processor finalizes all that is finalizable whilst meeting some basic stipulations per the standard.  IFORT appears to pass that test.  See what I write about the pathways.  Thus with IFORT, I'll leave it to yours and the Intel Fortran team's judgment on the best course of action. 

jimdempseyatthecove
Honored Contributor III
802 Views

I agree with FF's position. FWIW, from FF's description, there is an ambiguity as to order of the "print *,..." of b_t is to occur before or after the finalization of the components of b_t. In a Fortran procedure, allocatable local objects are implicitly deallocated after the procedure terminates (iow after the code of the procedure runs). This is consistent with the behavior presented in the sample program. There is no requirement for Fortran to behave like C++.

 

Steve Lionel would be an authority on this.

Jim Dempsey

0 Kudos
Barbara_P_Intel
Moderator
859 Views

@FortranFan I included a link to the github thread in the bug report. It's a good discussion. I'm sure the compiler developers will review all the comments.


0 Kudos
Barbara_P_Intel
Moderator
424 Views

This bug has been fixed and will be available in the next release of the compiler later this spring.

Thanks again for reporting it.



DataScientist
Valued Contributor I
415 Views

impressive. Thank you!

0 Kudos
Reply