view gcc/testsuite/gcc.dg/pr41033.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* { dg-options "-O1 -fno-strict-aliasing" } */
/* PR rtl-optimization/41033 */

struct X {
  int i;
  int j;
};

int foo(struct X *p, struct X *q)
{
  p->j = 1;
  q->i = 0;
  return p->j;
}

extern void abort (void);

int main()
{
  struct X x;
  if (foo (&x, (struct X *)&x.j) != 0)
    abort ();
  return 0;
}