Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.

Issue with Volatile in Fortran

HemantAgarwal
Beginner
206 Views
Planning to upgrade existing FORTRAN compiler version 2018 to latest version 2021.2
While doing some prework found compile error in following scenario -
INTEGER, pointer :: ABC(:)
COMMON /ABC/ ABC
VOLATILE /ABC/
INTEGER, pointer :: XYZ(:)
COMMON /XYZ/ XYZ
VOLATILE /XYZ/

getting following error, the first instance ABC works, basically single instance works.
internal error: Please visit 'http://www.intel.com/software/products/support' for assistance.
VOLATILE /XYZ/
^
[ Aborting due to internal error. ]
0 Kudos
3 Replies
FortranFan
Honored Contributor II
199 Views

@HemantAgarwal ,

 

An "internal error" suggests an ICE and if so, it's a compiler bug and submit a support request at Intel OSC if your subscription allows that:

https://supporttickets.intel.com/servicecenter?lang=en-US

 

Note however your syntax for VOLATILE statement is incorrect, check the Fortran standard or Intel documentation here.

 

Perhaps your actual code has it right?  If yes and there is issue with VOLATILE feature, Intel support will likely want to see actual code or a reproducer

HemantAgarwal
Beginner
187 Views
Possible to provide correct syntax in the given example for volatile.
Steve_Lionel
Black Belt Retired Employee
156 Views

The syntax you show, which names a COMMON block in a VOLATILE statement, is an extension supported by Intel Fortran. VOLATILE existed as an extension long before it was added to the standard. When the standard did add VOLATILE, it did not include the naming of a COMMON block here. However, as it is documented as supported by Intel Fortran, it should work.

The use of a deferred-shape pointer array in COMMON is unusual, and possibly a trigger for the compiler error, but it is allowed.

I do note that the bit of the source you posted, if made into a compilable source by adding an END statement, does compile in Intel Fortran 2021.2. Please provide a minimal example that does show the error - be sure to specify any compile options you are using.

 

Reply