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

Polymorphic function with array result

IanH
Honored Contributor II
281 Views
Apologies if this has already been covered with the previous posts about 11.1 on this forum.

The attached program demonstrates an issue with polymorphic function calls that have array results. I'd expect both the subroutine and the function to return two. When compiled using 11.1.038 with /check:all /warn:all the subroutine is ok, but the function path returns 1310184. I think the stack gets toasted, because in a larger program all hell breaks loose after a similar function call.

If my F2003 understanding is at fault please correct me!

Thanks,

IanH
0 Kudos
3 Replies
reinhold-bader
New Contributor II
281 Views
Quoting - IanH
Hello,

I think your source code is OK; checking with two other compilers confirmed this.
Regards
Reinhold

0 Kudos
Steven_L_Intel1
Employee
281 Views
Yes, it seems that the array-valued type-bound procedure is not returning its value correctly. I will report this to the developers. Issue ID is DPD200139698.
0 Kudos
Steven_L_Intel1
Employee
281 Views
This problem appears to be fixed in 11.1 Update 3, though it doesn't appear on the list of fixes. I think that's an oversight as the developer fixed the bug in September.
0 Kudos
Reply