comp.lang.ada
 help / color / mirror / Atom feed
* gnat3.10 optimization O2 on win95 - problem
@ 1997-11-06  0:00 William Paul Berriss
  1997-11-06  0:00 ` Robert Dewar
  0 siblings, 1 reply; 2+ messages in thread
From: William Paul Berriss @ 1997-11-06  0:00 UTC (permalink / raw)



Hi

Just to sya that I have compiled a program that uses lots and lots
of for loops (nested too) and on gnat 3.07 with optimization
-O2 and-O3 on solaris unix and red hat linux it take about 50 seconds to
run.

BUT, on gnat3.10 on win95 with -O2 optimization it seems to take
forever, it just stops (well looks like it does, heaven knows
what it is doing) near the start.
BUT with no optimization on win95 gnat3.10 it runs just fine,
taking about a minute as per gnat3.07.

So I would suggest that the -O2 optimizer on gnat3.10 for Win95
is a bit faulty.
Have others noticed this? I see no mention on the newsgroup today.

Any advice? knowledge to share on this matter?

Thank in advance

Will Berriss
-----------



W P Berriss                 E-mail: W.P.Berriss@reading.ac.uk
Department of Engineering
The University of Reading
Whiteknights
Reading                     Tel:  0118 987 5123 
Berkshire                     (+44 118 987 5123 outside UK)
RG6 6AY    
England                     Fax:  0118 931 3327    

World Wide Web Home Page: 

http://www.elec.rdg.ac.uk/people/postgrads/will.html








^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: gnat3.10 optimization O2 on win95 - problem
  1997-11-06  0:00 gnat3.10 optimization O2 on win95 - problem William Paul Berriss
@ 1997-11-06  0:00 ` Robert Dewar
  0 siblings, 0 replies; 2+ messages in thread
From: Robert Dewar @ 1997-11-06  0:00 UTC (permalink / raw)



W P Berriss says

<<BUT, on gnat3.10 on win95 with -O2 optimization it seems to take
forever, it just stops (well looks like it does, heaven knows
what it is doing) near the start.
BUT with no optimization on win95 gnat3.10 it runs just fine,
taking about a minute as per gnat3.07.

So I would suggest that the -O2 optimizer on gnat3.10 for Win95
is a bit faulty.
Have others noticed this? I see no mention on the newsgroup today.>>

It is a common misconception that a situation like this necessarily
means that there is an optimization problem. Of course this could
be the case (we do not see many optimization problems with GCC
these days, but we have seen occasional examples, and indeed these
examples are about evenly split between cases where optimization
works, and no optimization fails, and vice versa).

The point however is that if you write erroneous or legitimately
non-deterministic code, it can very well be the case that the
difference in behavior is perfectly legitimate, and does not
represent a flaw in the compiler.

In general when your program does not work, there are two possibilities.
Either your program is wrong, or the compiler is wrong. The situation
you report here is no different, and the same analysis holds. Usually
the best thing to do is to spend at least some time assuming that it
is your program, and debugging in the normal way. If this process
gets nowhere and you start to be convinced that there really is a 
bug, then narrow it down as far as possible, and send it to report@gnat.com
in the usual way.






^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1997-11-06  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-11-06  0:00 gnat3.10 optimization O2 on win95 - problem William Paul Berriss
1997-11-06  0:00 ` Robert Dewar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox