forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Bug in FTN95 compiler version 5.20.1?

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
yair999



Joined: 31 Mar 2008
Posts: 4

PostPosted: Wed Apr 02, 2008 8:53 pm    Post subject: Bug in FTN95 compiler version 5.20.1? Reply with quote

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
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Thu Apr 03, 2008 2:15 am    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7927
Location: Salford, UK

PostPosted: Thu Apr 03, 2008 7:01 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
yair999



Joined: 31 Mar 2008
Posts: 4

PostPosted: Thu Apr 03, 2008 1:36 pm    Post subject: some background Reply with quote

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
View user's profile Send private message
yair999



Joined: 31 Mar 2008
Posts: 4

PostPosted: Tue Jun 03, 2008 7:15 pm    Post subject: Re: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7927
Location: Salford, UK

PostPosted: Wed Jun 04, 2008 8:35 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group