Silverfrost Forums

Welcome to our forums

Bug in FTN95 compiler version 5.20.1?

2 Apr 2008 7:53 #2978

The following program yields the value of 1.00000 under debug win32 mode of FTN95 compiler version 5.20.1. The correct value should be 2.00000 I do get the correct value when the 'OPTIONS(CHECK)' is commented out.

Can someone check it out?

yair

  PRINT *,F2() 
  END 
  FUNCTION F1(X) 
  F1=X 
  END 
  OPTIONS(CHECK) 
  FUNCTION F2() 
  REAL X(1)/1./ 
  F2=ABS(F1(X(1)))*2. 
  END
3 Apr 2008 1:15 #2980

I tested the function F2, using a temporary variable and found when it did and did not work. I've listed the program below. Surprisingly the F1 call using a temporary variable doesn't works in :- y = ABS (F1(X(1))) * 2. f2 = y

I used ftn95 Ver 4.9.1, so it is not a recent bug.

Regards John

! Test code real f2 PRINT *,F2() END

real FUNCTION F1 (X) real x F1=X END

OPTIONS(CHECK) real FUNCTION F2() real f1 , y external f1 REAL X(1)/1./ ! ! this works ! y = F1(X(1)) ! f2 = abs(y) * 2. ! ! this works ! y = ABS (F1(X(1))) ! f2 = y * 2. ! ! this doesn't works y = ABS (F1(X(1))) * 2. f2 = y ! ! this doesn't work ! F2 = ABS (F1(X(1))) * 2. END

3 Apr 2008 6:01 #2981

Thanks for the bug report. It appears to be a new bug rather than a regression. A temporary work-around is to put the 2 at the beginning.

3 Apr 2008 12:36 #2983

I'd like to add that my example was the minimal program that demonstrates my original problem: A 12,000 lines legacy code which yielded 'slightly' different results under CHECKMATE mode than under DEBUG or RELEASE (the last two being identical).

Yair

3 Jun 2008 6:15 #3296

Quoted from PaulLaidler Thanks for the bug report. It appears to be a new bug rather than a regression. A temporary work-around is to put the 2 at the beginning.

This bug was not fixed in the recent 5.21 version.

Is it planned to be fixed in the next version?

Thanks

4 Jun 2008 7:35 #3297

We have only just fixed this bug so I don't think that the fix will have got into the current release.

Please login to reply.