This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: basic VRP min/max range overflow question
- From: Robert Dewar <dewar at adacore dot com>
- To: Paul Schlie <schlie at comcast dot net>
- Cc: Michael Veksler <VEKSLER at il dot ibm dot com>, Dale Johannesen <dalej at apple dot com>,GCC Development <gcc at gcc dot gnu dot org>, "Joseph S. Myers" <joseph at codesourcery dot com>,Mike Stump <mrs at apple dot com>, Andrew Pinski <pinskia at physics dot uc dot edu>
- Date: Mon, 20 Jun 2005 08:38:36 -0400
- Subject: Re: basic VRP min/max range overflow question
- References: <BEDC29FA.A8D6%schlie@comcast.net>
Paul Schlie wrote:
- You may be correct, although it's not obviously the case? (As requiring
all undefined behavior be encapsulated between sequence points already
seems implied to me, as I don't see any explicit counter examples
requiring otherwise.
There don't need to be examples. The as-if rule always applies, if you cannot
write a legitimate C program that shows the difference between two possible
implementations, then both are correct. Note that the requirement of a legitimate
C program exlude ANY program which has undefined behavior anywhere.
> Nor do any optimizations which are obviously more
> useful than potentially counterproductive seem to require the violation of
> C's sequence point semantics?)
Ordinary code motion optimizations like hoisting out of a loop are an obvious
example, there are lots of others. If you read the dragon book (are you familiar
with this book?) then almost all optimizations discussed there in the global
optimization chapters would be affected.