comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: gnat3.10 optimization O2 on win95 - problem
Date: 1997/11/06
Date: 1997-11-06T00:00:00+00:00	[thread overview]
Message-ID: <dewar.878825693@merv> (raw)
In-Reply-To: Pine.SOL.3.96.971106064850.15977A-100000@suma3.reading.ac.uk


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.






      reply	other threads:[~1997-11-06  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-11-06  0:00 gnat3.10 optimization O2 on win95 - problem William Paul Berriss
1997-11-06  0:00 ` Robert Dewar [this message]
replies disabled

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