[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
Tue May 13 12:44:00 GMT 2008



------- 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



More information about the Gcc-bugs mailing list