http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49279

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-10-04 
16:57:36 UTC ---
Short testcase that is miscompiled:
struct S { int a; int *__restrict p; };

struct S *bar (struct S *);

int
foo (int *p, int *q, int z)
{
  struct S s, *t;
  s.a = 1;
  s.p = p;
  t = bar (&s);
  t->p = q;
  s.p[0] = 0;
  t->p[0] = 1;
  return s.p[0];
}

If bar returns the parameter it has been passed, s and *t are the same object,
so it must return 1 instead of 0 that 4.6 as well as trunk return.

Reply via email to