Operating System - OpenVMS
Showing results for 
Search instead for 
Did you mean: 

Fortran 16-Byte Real optimization error


Fortran 16-Byte Real optimization error

The HP IA64 Fortran v8.1 compiler gives a "Compiler intenal error" with 16-Byte Reals.

If anyone can verify this behavior on new versions, it should be submited as a Problem Report.


I whittled the offending program down to this test subroutine:


Subroutine test( C  )
Double Precision A, B, C
Common / te1 /   A, B

if( C .le. 0. ) then
A = 0.
A = A - B



Compiling with  $Fortran /real=64 /int=64 /opt   crashes the compiler.

Compiling with /opt=lev=1 works OK.

Commenting out any single executable line works OK also.


For comparison, compiling on AXP Fortran v7.6 gives no error even with opt=lev=5.


I use 16-Byte Double Precision frequently, so any comments on possible causes of this

oddity would be appreciated.


C. Fred Driscoll

UCSD Physics



Hein van den Heuvel
Honored Contributor

Re: Fortran 16-Byte Real optimization error

Compiles cleanly under  HP Fortran V8.2-104939 with the command you give.

(Itanium 8.3-1h1)





listing snippets.



Address Type Name Address Type Name Address Type Name

2-00000000 R*8 A 2-00000008 R*8 B ** R*8 C

TEST Source Listing 11-JAN-2012 17:22:45 HP Fortran V8.2-104939 Page 2
11-JAN-2012 17:22:19 SYS$SYSDEVICE:[HEIN]TMP.FOR;3





John Gillings
Honored Contributor

Re: Fortran 16-Byte Real optimization error

If only all reproducers were as good as yours!


A compiler crashing is always a bug, please make a formal report to HP.


Always test compiler problems against the latest version of the compiler. This is easy to do and non-privileged. Most compilers these days have mechanisms to allow you to maintain multiple versions. Even if the specific product doesn't have the feature, it's fairly easy to do yourself using logical names. Extract a later compiler from a kit, place it in your private directory and point to it by logical name logical name.


Hein's evidence shows that the bug may have been fixed in a later compiler, however, it's not possible to say if that's by design or by accident, so it's better if the compiler team see your excellent example. They can also add it to the regression suite to make sure the bug doesn't reappear.

A crucible of informative mistakes