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

Issue with Volatile in Fortran

HemantAgarwal
Beginner
478 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
471 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

0 Kudos
HemantAgarwal
Beginner
459 Views
Possible to provide correct syntax in the given example for volatile.
0 Kudos
Steve_Lionel
Honored Contributor III
428 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.

 

0 Kudos
Reply