[Bug middle-end/36227] [4.3/4.4 Regression] POINTER_PLUS folding introduces undefined overflow
rguenth at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Fri Jan 16 18:57:00 GMT 2009
------- Comment #10 from rguenth at gcc dot gnu dot org 2009-01-16 18:56 -------
C testcase, fails with 4.3 and 4.4 with -O2 --param
max-fields-for-field-sensitive=0
#include <stdint.h>
extern void abort (void);
int main()
{
int i = 1;
int *p = &i;
uintptr_t iptr;
iptr = (uintptr_t)p - (uintptr_t)&iptr;
p = (int *)((uintptr_t)&iptr + iptr);
if (*p != 1)
abort ();
return 0;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36227
More information about the Gcc-bugs
mailing list