PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-fre-61.c
bloba4d9a7194bf8a05b37b3612a5570b59de3b16a20
1 /* { dg-do link } */
2 /* { dg-options "-O -fdump-tree-fre1-details" } */
4 void link_error (void);
6 void test1 (int *p, int *q)
8 *p = 1;
9 *q = 1;
10 if (*p != 1)
11 link_error ();
14 void test2 (int *p, int *q, int t)
16 *p = t;
17 *q = t;
18 if (*p != t)
19 link_error ();
22 void test3 (int *q, int *p)
24 int tem = *p;
25 *q = tem;
26 if (*p != tem)
27 link_error ();
30 char a[4];
31 struct A { char a[4]; };
32 void test4 (struct A *p)
34 a[0] = p->a[0];
35 a[0] = p->a[0];
36 a[0] = p->a[0];
39 int main() { return 0; }
41 /* { dg-final { scan-tree-dump-times "Replaced \\\*p" 3 "fre1" } } */
42 /* { dg-final { scan-tree-dump-times "Replaced p_.\\(D\\)->" 2 "fre1" } } */
43 /* { dg-final { scan-tree-dump-times "Deleted redundant store a\\\[0\\\]" 2 "fre1" } } */