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 

varying results caused by different compiler options

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



Joined: 23 Aug 2005
Posts: 46
Location: Berlin, Germany

PostPosted: Mon Feb 04, 2008 9:03 pm    Post subject: varying results caused by different compiler options Reply with quote

Hello Paul,

a customer sent me the following sample program which is sorting some data. We would expect that the result is independent from the compiler options being used but unfortunately it is is not. It appears to me that there is a bug in the optimizer. Please check. Thank you.

Kind regards
Jörg Kuthe
www.qtsoftware.de
- - - - - - - - - - - - - - - - -
implicit none
integer index(10)
integer i,ii,j,jj,k,n
character*1 cq(10),ci,cj
data cq/'X','E','X','I','A','X','F','X','B','X'/
n=10
do i=1,n
index(i)=i
end do
n=10
! do i=1,9 CORRECT
! do i=1,n-1 file option: standard optimization WRONG
! do i=1,n-1 file option: full optimization WRONG
! do i=1,n-1 file option: include debug CORRECT
! do i=1,n-1 file option: checkmate enabled CORRECT
do i=1,n-1
ii=index(i); ci=cq(ii); k=i
if (ci.eq.'X') cycle
do j=i+1,n
jj=index(j); cj=cq(jj)
if (cj.eq.'X') cycle
if (cq(jj).lt.ci) then
ci=cq(jj)
ii=jj
k=j
end if
end do
index(k)=index(i)
index(i)=ii
end do
write(6,'(10i3)') index(1:n)
write(6,'(10(2x,a1))') (cq(index(i)),i=1,n)
!
! Faulty Result 1 9 3 2 5 6 7 8 4 10
! X B X E A X F X I X
!
! Correct Result 1 5 3 9 2 6 7 8 4 10
! X A X B E X F X I X
stop
end
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Mon Feb 04, 2008 11:14 pm    Post subject: Reply with quote

Jörg

We will take a look at this and get back to you as soon as we can.

Regards

Paul
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Thu Mar 06, 2008 5:34 pm    Post subject: Reply with quote

This bug has been fixed for the release that is about to go out.
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