This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Ada front-end depends on signed overflow
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: GCC List <gcc at gcc dot gnu dot org>, bosch at gnat dot com
- Date: Fri, 03 Jun 2005 15:02:42 +0200
- Subject: Re: Ada front-end depends on signed overflow
- References: <f75a567a7675c4bf7a504893c032af98@physics.uc.edu>
* Andrew Pinski:
> The Ada front-end is still being missed compiled by VRP but VRP is doing
> the correct thing as the type is signed and overflow on signed is
> undefined
> (-fwrapv is not turned on by default for Ada).
It probably makes sense to turn on -fwrapv for Ada because even
without -gnato, the behavior is not really undefined:
| The reason that we distinguish overflow checking from other kinds of
| range constraint checking is that a failure of an overflow check can
| generate an incorrect value, but cannot cause erroneous behavior.
<http://gcc.gnu.org/onlinedocs/gcc-4.0.0/gnat_ugn_unw/Run_002dTime-Checks.html>
(Without -fwrapv, integer overflow is undefined, and subsequent range
checks can be optimized away, so that it might cause erroneous
behavior.)