------- Comment #8 from rguenth at gcc dot gnu dot org 2008-01-15 14:44 -------
Reduced testcase:
int f(char *device)
{
return device == ((char *)0 + ~0UL);
}
for building the POINTER_PLUS_EXPR we convert the unsigned offset to
sizetype which causes the double-int (-1, 0) to sign-extend to (-1, -1)
signalling overflow (the positive value doesn't fit in sizetype).
In the context of POINTER_PLUS_EXPRs the sizetype offset depending on
evaluation context has an effective range of [-INT_MIN, UINT_MAX].
So in principle we want to not treat the sign/zero extension
that happens when converting from/to sizetype as overflow.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|pinskia at gcc dot gnu dot |rguenth at gcc dot gnu dot
|org |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32628