This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/36227] [4.3/4.4 Regression] POINTER_PLUS folding introduces undefined overflow
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Jan 2009 18:56:51 -0000
- Subject: [Bug middle-end/36227] [4.3/4.4 Regression] POINTER_PLUS folding introduces undefined overflow
- References: <bug-36227-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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