comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Curiosity about rage checking
Date: Thu, 07 Feb 2008 11:45:46 -0500
Date: 2008-02-07T11:45:46-05:00	[thread overview]
Message-ID: <wcclk5wlnph.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 29e89783-8802-474e-b3c7-9721407ce42e@s13g2000prd.googlegroups.com

"framefritti@gmail.com" <framefritti@gmail.com> writes:

> My question is: is an Ada compiler allowed to move the check outside
> the loop?

Yes.  However, if A > B (i.e. the loop will go around zero times), then
the compiler must make sure the exception is not raised.

>   2. Moving the check outside the loop changes the program behaviour

RM-11.6 allows certain behavior changes.  Exceptions can be moved
around, for example, so long as the right handler applies.

See AARM-1.1.2(39.c) for the difference between "behavior" and
"semantics".

>  3. It make debugging harder

The RM says almost nothing about debugging.  But Ada compilers typically
have a no-optimize switch that suppresses optimizations that would harm
debugging.

- Bob



  parent reply	other threads:[~2008-02-07 16:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-07  8:17 Curiosity about rage checking framefritti
2008-02-07  8:45 ` Maciej Sobczak
2008-02-07  9:55 ` Jean-Pierre Rosen
2008-02-07 10:36   ` framefritti
2008-02-07 11:21     ` Dmitry A. Kazakov
2008-02-07 15:57   ` Adam Beneschan
2008-02-07 16:45 ` Robert A Duff [this message]
2008-02-07 16:54 ` Adam Beneschan
replies disabled

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