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: Diego Novillo <dnovillo at redhat dot com>, Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>,GCC Development <gcc at gcc dot gnu dot org>
- Date: Fri, 17 Jun 2005 22:02:29 -0400
- Subject: Re: basic VRP min/max range overflow question
- References: <BED8E10F.A872%schlie@comcast.net>
Paul Schlie wrote:
(As there's nothing in the standard which enables an implementation
to subsequently disregard the resulting value of an implementation
specific operation from the best I can tell; although would welcome
someone pointing out where specifically it's allowed. As unless
it is, an undefined result is specific to the just that operation.
It does not magically alter the semantics well defined operations
which may utilize that result, regardless of it's value.)
["undefined" only provides liberties within the constrains of what
is specifically specified as being undefined, but none beyond that.]
You are forgetting the "as if" semantics that is always inherent in
the standard. So after an operation with an undefined result, we can
do anything we like with the value, since it is "as if" the operation
had produced that value. So for example, if we skip an operation because
we know it will overflow, and end up using uninitialized junk in a register,
it is "as if" that undefined operation produced the particular uninitialized
junk value that we ended up with.
So the above is inventive but wrong.