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

Circular type references

IanH
Honored Contributor III
905 Views
The following causes an ICE with 11.1, which I have reported to premier support. But I have two follow up questions:

- is it legitimate Fortran? The forward reference to B_type in A_type is ok because of the POINTER attribute, isn't it?

- are there any workarounds to the ICE?

I would have thought this sort of arrangment would have been reasonably common for data tree arrangments.

Thanks for any advice,

IanH

[cpp]MODULE TestCircular
IMPLICIT NONE
TYPE A_type
TYPE(B_type), POINTER :: lots_of_bees(:)
INTEGER d
END TYPE A_type
TYPE B_type
TYPE(A_type), ALLOCATABLE :: some_ays(:)
INTEGER d
END TYPE B_type
END MODULE TestCircular
[/cpp]
0 Kudos
5 Replies
TimP
Honored Contributor III
905 Views
An ICE is always a bug, If the source code is unacceptable, the compiler should attempt to provide a diagnosis. With my most recent copy of ifort 11.1 beta for x86_64, I have to set -diag-enable sc, which you didn't mention, in order to provoke a compile time segmentation violation. So it does seem there is a bug, at least in that option. Trying options -stand=f95 and -stand=f03, the compiler says you are using an extension to f95 (a warning, not a failure), but has no complaint about f03.
0 Kudos
IanH
Honored Contributor III
905 Views
Quoting - tim18
An ICE is always a bug, If the source code is unacceptable, the compiler should attempt to provide a diagnosis. With my most recent copy of ifort 11.1 beta for x86_64, I have to set -diag-enable sc, which you didn't mention, in order to provoke a compile time segmentation violation. So it does seem there is a bug, at least in that option. Trying options -stand=f95 and -stand=f03, the compiler says you are using an extension to f95 (a warning, not a failure), but has no complaint about f03.

Thanks. What's the windows command line or IDE equivalent of the -diag-enable option you mention? F03 is my target.

(If the option you listed was for static verification then I am not using that - at the moment I get an ICE with what is just the out-of-the-box IA32 command line build environment with 11.1 build 35, with no additional ifort command line options.)

IanH
0 Kudos
Steven_L_Intel1
Employee
905 Views
I can get an ICE with no options. -diag-enable-sc is static verifier/source checker and would not create an executable if you used it.

This code should work and I am astonished it doesn't. Thanks for reporting it. You can use 11.0.074 to compile this.
0 Kudos
Lorri_M_Intel
Employee
905 Views

Yes, this bug was in the compiler proper (not part of extra diagnostic checking) and has been fixed for an 11.1 update.

- Lorri
0 Kudos
Steven_L_Intel1
Employee
905 Views
This problem was corrected in 11.1 Update 1.
0 Kudos
Reply