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: 13 May 2008 12:43:36 -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 #1 from rguenth at gcc dot gnu dot org 2008-05-13 12:43 -------
Err - only with volatiles ... !?
volatile unsigned long * sat_add(volatile unsigned long *ptr, unsigned long i,
volatile unsigned long *end)
{
if ((unsigned long)ptr + i * sizeof(*ptr) > (unsigned long)ptr)
return ptr + i;
else
return end;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36227