diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr41033.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/pr41033.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr41033.c b/gcc/testsuite/gcc.dg/pr41033.c new file mode 100644 index 00000000000..5043be2d119 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr41033.c @@ -0,0 +1,24 @@ +/* { 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; +} |