Debian Codegraph @

gcc/testsuite/gcc.dg/tree-ssa/alias-access-path-3.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-fre1" } */
3 struct a {int v1;
4 int v2;};
5 struct b {struct a a[0];};
6
7 int
8 test (struct b *bptr1, struct b *bptr2, int i, int j)
9 {
10 bptr1->a[i].v1=123;
11 bptr2->a[j].v2=1;
12 return bptr1->a[i].v1;
13 }
14 int
15 test2 (struct b *bptr1, struct b *bptr2, int i, int j)
16 {
17 bptr1->a[i].v1=123;
18 bptr2->a[j].v1=1;
19 return bptr1->a[i].v1;
20 }
21 /* test should be optimized, while test2 should not. */
22 /* { dg-final { scan-tree-dump-times "return 123" 1 "fre1"} } */