Reputation: 3852
When I compile my code with
gfortran -O2 calpuff.for -o calpuff.exe
The following code:
REAL FUNCTION R1MACH (I)
C***BEGIN PROLOGUE R1MACH
C ...
real SMALL(2)
real LARGE(2)
real RIGHT(2)
real DIVER(2)
real LOG10(2)
c --- Set up for IBM PC: declare as reals ..........(DGS)
C
REAL RMACH(5)
SAVE RMACH
C
EQUIVALENCE (RMACH(1),SMALL(1))
EQUIVALENCE (RMACH(2),LARGE(1))
EQUIVALENCE (RMACH(3),RIGHT(1))
EQUIVALENCE (RMACH(4),DIVER(1))
EQUIVALENCE (RMACH(5),LOG10(1))
C ...
DATA SMALL(1) / 1.18E-38 /
DATA LARGE(1) / 3.40E+38 /
DATA RIGHT(1) / 0.595E-07 /
DATA DIVER(1) / 1.19E-07 /
DATA LOG10(1) / 0.30102999566 /
C ...
C***FIRST EXECUTABLE STATEMENT R1MACH
IF (I .LT. 1 .OR. I .GT. 5) CALL XERMSG ('SLATEC', 'R1MACH',
+ 'I OUT OF BOUNDS', 1, 2)
C
R1MACH = RMACH(I)
RETURN
C
END
Result shows in the following error:
calpuff.for: In function ‘r1mach’:
calpuff.for:58522: fatal error: gfc_todo: Not Implemented: Initialization of overlapping variables
compilation terminated.
Line 58522 corresponds to the first line of the code shown.
Why does this error occur?
Some information about my compiler: gcc version 4.1.2 20080704 (Red Hat 4.1.2-54)
Upvotes: 1
Views: 116
Reputation: 18118
This is a known compiler bug in gfortran
, see here and here. This bug has been fixed in 2007.
Please update to a more recent version of gfortran
.
Upvotes: 3