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 

Bad code generated for WHERE constructs
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Sat May 02, 2015 3:31 am    Post subject: Reply with quote

Quote:
It is also interesting that it has taken 20 years for this bug to be identified


not really surprising though as probably no one has tried to use a
"(/(j,j=1,n)/)" type statement within a WHERE , which is pretty rare I would guess.
After all the code has been generated by a machine (albeit a man-made one Wink ) not a youmanbeing, machines are not infallible .. .hence, err , humans are not infa-.... now I'm getting myself in a mess

WHERE (answer=.incorrect).
machine.ne.you_man
endwhere
EXCEPT IF ! <------- (does this exist ???)
.
.
.

I wonder how old the 'translator' is (not that its relevant to the fact the code won't run, just wrt the 20-year comment because if it didn't exist say 5 years ago then the surprise factor reduces, as I wouldn't think a you-man would even attempt to put where'S INTO IT, AS HAS BEEN 'PROVEN' BY THE OPINIONS ON THIS POST :=)
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Jun 01, 2016 8:05 am    Post subject: Reply with quote

This has now been fixed for the next release.

Note that the two arrays "ae1u > a(2,a01u)" and "(/(j,j=1,n)/)" are constant with respect to the WHERE construct so it would be better to store them before the beginning of the associated WHERE. As it is they are, they are recalculated each time around. Also there are can memory issues when the compiler adjusts the stack for the temporary arrays (depending on the size of the array and the number of times through the loop).

I guess that an optimising compiler could move these "constant" arrays out of the loop but that would be a fairly tall order.
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
Goto page Previous  1, 2
Page 2 of 2

 
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