replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Bug with optimise?
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 with optimise?

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



Joined: 24 May 2014
Posts: 2

PostPosted: Sat May 24, 2014 9:24 pm    Post subject: Bug with optimise? Reply with quote

Hi,

I think I have a bug with /optimise. The following function performs differently with compiled with and without the option. Essentially it is supposed to remove any leading spaces from a character string and append a letter 'A'.

I correctly get 'helloA' without optimise. But with it I get 'hello @'.

Note - I've found several ways to re-write the code that do let it compile correctly with /optimise, so it must be something specific about this structure. (Even adding a PRINT *,J into the inner loop fixes it.
Also note - this is a simplified example to highlight the problem - so no need to suggest ways to improve the code!

Thanks,
Mark.

character*10 :: qqq
character*10 :: a,b
a=' hello'
b=qqq(a)
print *,a
print *,b
end

character*10 function qqq(a)
implicit none
character*10 :: a
integer :: i,j
do i=1,9
if(a(i:i)/=' ') then
do j=i+1,10
if(a(j:j)==' ') then
qqq=a(i:j-1)//'A'
return
end if
end do
end if
end do
qqq='XXXXXXXXXX'
return
end
Back to top
View user's profile Send private message
sentinel7



Joined: 24 May 2014
Posts: 2

PostPosted: Sat May 24, 2014 9:29 pm    Post subject: Reply with quote

Forgot to say - I'm using V7.00.0
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Sun May 25, 2014 9:33 pm    Post subject: Reply with quote

This is clearly a bug but to optimise this code you should use the standard intrinsic ADJUSTL.
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