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: Robert Dewar <dewar at adacore dot com>
- To: Paul Schlie <schlie at comcast dot net>
- Cc: Andrew Pinski <pinskia at physics dot uc dot edu>,Florian Weimer <fw at deneb dot enyo dot de>, GCC List <gcc at gcc dot gnu dot org>,bosch at gnat dot com
- Date: Mon, 06 Jun 2005 08:25:08 -0400
- Subject: Re: Ada front-end depends on signed overflow
- References: <BEC9AD75.A63C%schlie@comcast.net>
Paul Schlie wrote:
- So technically as such semantics are undefined, attempting to track
and identify such ambiguities is helpful; however the compiler should
always optimize based on the true semantics of the target, which is
what the undefined semantics truly enable (as pretending a target's
semantics are different than the optimization assumptions, or forcing
post-fact run-time trapping semantics, are both useless and potentially
worse, inefficient and/or erroneous otherwise).
The first part of this is contentious, but arguable certainly (what is
useful behavior). There is certainly no requirement that the semantics
should match that of the target, especially since that's ill-defined
anyway (for targets that have many different kinds of arithemetic
instructions).
The second part is wrong, it is clear that there are cases where
the quality of code can be improved by really taking advantage of the
undefinedness of integer overflow.