13.0 compiler bug: bad object code for user-defined constructor used in assignment

13.0 compiler bug: bad object code for user-defined constructor used in assignment

Neil Carlson's picture

I've attached a short example (mostly declarations, only a few executable statements) for which the 13.0 compiler is generating bad object code.  The offending statement is an intrinsic assignment of a derived type with pointer component where the rhs is a user-defined constructor.  I point out a couple variations where the code will run correctly.

AttachmentSize
Download intel-bug-20121014.f902.23 KB
5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Kevin Davis (Intel)'s picture

Thank you for reporting this issue Neil and for the convenient reproducer. I confirmed your results and reported this to the Fortran Developers (internal tracking id noted below) for further analysis/repair. I will update this thread after learning more.

(Internal tracking id: DPD200237446)

(Resolution Update on 02/08/2013): This defect is fixed in the Intel Fortran Composer XE 2013 Update 2 (2013.2.146 - Linux)

Kevin Davis (Intel)'s picture

I wanted to share our Developer’s comments w/you, Neil. She is working on a fix and I'll update on availability as it becomes known.

She wrote:

First, kudos to the submitter for such a concise reproducer.

Really, what it needed to fail was the following set of circumstances:

1) a TYPE that contains an allocatable CLASS
2) a function that returns that type (or a type that contains that type)
3) that function needs to be called from multiple program units.

Kevin Davis (Intel)'s picture

Neil - I confirmed this defect is fixed in our internal builds and expect the fix to be in our next XE2013 update 2 (tentatively in late January). The offending intrinsic assignment now also returns T when using our internal build.

Thank you again for reporting this defect and convenient reproducer.

Kevin Davis (Intel)'s picture

This defect is fixed in the Intel Fortran Composer XE 2013 Update 2 (2013.1.146 - Linux)

Login to leave a comment.