This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Checking of TREE_CONSTANT_OVERFLOW in integer_(non)zerop


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]