This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Checking of TREE_CONSTANT_OVERFLOW in integer_(non)zerop
- From: "Joseph S. Myers" <jsm at polyomino dot org dot uk>
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 10 Jun 2004 00:50:36 +0000 (UTC)
- Subject: Re: Checking of TREE_CONSTANT_OVERFLOW in integer_(non)zerop
- References: <20040609183940.GA1663@atrey.karlin.mff.cuni.cz>
On Wed, 9 Jun 2004, Zdenek Dvorak wrote:
> why do we check for TREE_CONSTANT_OVERFLOW in integer_(non)zerop?
> The attached patch bootstraps & passes regtesting on i686 without any
> problems.
I'd guess it's for the (broken) checks using integer_zerop to test for
whether something is a null pointer constant. E.g.,
#include <limits.h>
void f(void) { void *p = INT_MIN + INT_MIN; }
is a constraint violation: INT_MIN + INT_MIN can't be an integer constant
expression, because its value is outside the range of representable values
of its type. (Though quite how that constraint is to be interpreted in
cases where a non-constant-expression is syntactically valid but whether
an expression is valid affects the interpretation of the code is unclear.)
--
Joseph S. Myers
jsm@polyomino.org.uk