Checking of TREE_CONSTANT_OVERFLOW in integer_(non)zerop

Joseph S. Myers jsm@polyomino.org.uk
Thu Jun 10 00:50:00 GMT 2004


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



More information about the Gcc mailing list