View previous topic :: View next topic |
Author |
Message |
yair999
Joined: 31 Mar 2008 Posts: 4
|
Posted: Wed Apr 02, 2008 8:53 pm Post subject: Bug in FTN95 compiler version 5.20.1? |
|
|
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 |
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2554 Location: Sydney
|
Posted: Thu Apr 03, 2008 2:15 am Post subject: |
|
|
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 |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Thu Apr 03, 2008 7:01 am Post subject: |
|
|
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. |
|
Back to top |
|
|
yair999
Joined: 31 Mar 2008 Posts: 4
|
Posted: Thu Apr 03, 2008 1:36 pm Post subject: some background |
|
|
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 |
|
Back to top |
|
|
yair999
Joined: 31 Mar 2008 Posts: 4
|
Posted: Tue Jun 03, 2008 7:15 pm Post subject: Re: |
|
|
PaulLaidler wrote: | 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 |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Wed Jun 04, 2008 8:35 am Post subject: |
|
|
We have only just fixed this bug so I don't think that the fix will have got into the current release. |
|
Back to top |
|
|
|