[Bug middle-end/87610] New: [6/7/8/9 Regression] wrong-code with restrict

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Oct 15 10:53:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87610

            Bug ID: 87610
           Summary: [6/7/8/9 Regression] wrong-code with restrict
           Product: gcc
           Version: 8.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

extern void abort (void);

void __attribute__((noinline)) g(int **a, int *b)
{
  *a = b;
}

int foo(int * restrict p, int *q)
{
  g(&q, p);
  *p = 1;
  *q = 2;
  return *p + *q;
}

int main()
{
  int x, y;
  if (foo(&x, &y) != 4)
    abort ();
  return 0;
}


More information about the Gcc-bugs mailing list