comp.lang.ada
 help / color / mirror / Atom feed
* Data_Error - GNAT -O3 problem
@ 1998-08-06  0:00 arthurw
  1998-08-06  0:00 ` Samuel Tardieu
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: arthurw @ 1998-08-06  0:00 UTC (permalink / raw)


I've found another troublesome quirk in GNAT's -O3 mode -- Data_Errors are no
longer propagated by the Text_Io packages (it worked fine without
optimization). This is quite disturbing, to say the least, since it clobbers
my attempt to catch bad input data formatting before calculating with it. :-(
 Is anyone else familiar with this phenomenon, or did I miss some fine print
somewhere?

Also, I posted before about another -O3 problem, but haven't seen any
response on the issue (maybe it's that bad of a problem :) . -O3 generates a
Program_Error when a procedure that was supplied with an access to procedure
parameter tries to pass that access to procedure parameter to another
procedure. Is there a trick to this that non-optimized mode doesn't require?
I found that using -O1 caused the program to get stuck and hang (CPU usage at
100% doing nothing).

Any help on these issues would be appreciated!

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum




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

* Re: Data_Error - GNAT -O3 problem
  1998-08-06  0:00 Data_Error - GNAT -O3 problem arthurw
  1998-08-06  0:00 ` Samuel Tardieu
@ 1998-08-06  0:00 ` arthurw
  1998-08-07  0:00   ` Robert Dewar
  1998-08-07  0:00 ` David Coote
  2 siblings, 1 reply; 6+ messages in thread
From: arthurw @ 1998-08-06  0:00 UTC (permalink / raw)


In article <6qcdr1$hrp$1@nnrp1.dejanews.com>,
  arthurw@bigfoot.com wrote:
> I've found another troublesome quirk in GNAT's -O3 mode -- Data_Errors are no
> longer propagated by the Text_Io packages (it worked fine without
> optimization).

My apologies, this is definitely an open-mouth-insert-foot situation. I reran
the problematic piece of code later and realized this is not the case. What
happened (and confused me first thing in the morning :) is GNAT apparently is
calculating NaNs without optimization, but raises Constraint_Error instead
with -O3 enabled. No problem, it's all fine and legal as far as I can tell.
However, I would like to know why there is this difference in the use of
NaNs, since it really messes with error handling mechanisms.

Sorry for the mistake to anyone who took notice of it.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum




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

* Re: Data_Error - GNAT -O3 problem
  1998-08-06  0:00 Data_Error - GNAT -O3 problem arthurw
@ 1998-08-06  0:00 ` Samuel Tardieu
  1998-08-06  0:00   ` arthurw
  1998-08-06  0:00 ` arthurw
  1998-08-07  0:00 ` David Coote
  2 siblings, 1 reply; 6+ messages in thread
From: Samuel Tardieu @ 1998-08-06  0:00 UTC (permalink / raw)


>>>>> "Arthur" == arthurw  <arthurw@bigfoot.com> writes:

Arthur> Also, I posted before about another -O3 problem, but haven't
Arthur> seen any response on the issue (maybe it's that bad of a
Arthur> problem :)

Could it be because you're vague and don't even write which platform
or version of GNAT you're using?

  Sam
-- 
Samuel Tardieu -- sam@ada.eu.org




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

* Re: Data_Error - GNAT -O3 problem
  1998-08-06  0:00 ` Samuel Tardieu
@ 1998-08-06  0:00   ` arthurw
  0 siblings, 0 replies; 6+ messages in thread
From: arthurw @ 1998-08-06  0:00 UTC (permalink / raw)


In article <m3iuk6ukrv.fsf@zaphod.enst.fr>,
  Samuel Tardieu <sam@ada.eu.org> wrote:

> Arthur> Also, I posted before about another -O3 problem, but haven't
> Arthur> seen any response on the issue (maybe it's that bad of a
> Arthur> problem :)
>
> Could it be because you're vague and don't even write which platform
> or version of GNAT you're using?

I wouldn't expect so, when the original post last week indicated this was
occuring with GNAT 3.10p on Win NT4, but you're right, it never hurts to
repeat it again.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum




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

* Re: Data_Error - GNAT -O3 problem
  1998-08-06  0:00 ` arthurw
@ 1998-08-07  0:00   ` Robert Dewar
  0 siblings, 0 replies; 6+ messages in thread
From: Robert Dewar @ 1998-08-07  0:00 UTC (permalink / raw)


<<My apologies, this is definitely an open-mouth-insert-foot situation. I reran
the problematic piece of code later and realized this is not the case. What
happened (and confused me first thing in the morning :) is GNAT apparently is
calculating NaNs without optimization, but raises Constraint_Error instead
with -O3 enabled. No problem, it's all fine and legal as far as I can tell.
However, I would like to know why there is this difference in the use of
NaNs, since it really messes with error handling mechanisms.
>>


Sounds like your program may well be erroneous! It is often the case that
programs that behave differently in different optimization modes are in
fact erroneous, and hence that a change in behavior with optimization
levels is perfectly legitimate.





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

* Re: Data_Error - GNAT -O3 problem
  1998-08-06  0:00 Data_Error - GNAT -O3 problem arthurw
  1998-08-06  0:00 ` Samuel Tardieu
  1998-08-06  0:00 ` arthurw
@ 1998-08-07  0:00 ` David Coote
  2 siblings, 0 replies; 6+ messages in thread
From: David Coote @ 1998-08-07  0:00 UTC (permalink / raw)



>
>Also, I posted before about another -O3 problem, but haven't seen any
>response on the issue (maybe it's that bad of a problem :)

Maybe this isn't going to help you much right now but I've found the GNAT 
people to do a pretty good job of quickly fixing bugs when we've reported 
them. We do have a support contract.

David






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

end of thread, other threads:[~1998-08-07  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-08-06  0:00 Data_Error - GNAT -O3 problem arthurw
1998-08-06  0:00 ` Samuel Tardieu
1998-08-06  0:00   ` arthurw
1998-08-06  0:00 ` arthurw
1998-08-07  0:00   ` Robert Dewar
1998-08-07  0:00 ` David Coote

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