re PR tree-optimization/34172 (Missed store ccp optimization)
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / 20031106-4.c
blobd727886917053ad59d78fce44ab59778b6cf3f15
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fdump-tree-optimized" } */
4 extern void link_error (void);
6 /* Check for cprop on fields of the same struct. */
8 struct s
10 char d;
11 int a, b;
12 double m;
16 void foo (struct s* r)
18 r->a = 0;
19 r->b = 1;
20 r->a++;
21 r->b++;
22 if (r->a != 1)
23 link_error ();
24 if (r->b != 2)
25 link_error ();
28 /* There should be no link_error calls. */
29 /* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" } } */
30 /* { dg-final { cleanup-tree-dump "optimized" } } */