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
492 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
436 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

4 Replies
Barbara_P_Intel
Moderator
437 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
390 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
Black Belt
315 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

Barbara_P_Intel
Moderator
372 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.


Reply