PR tree-optimization/33562
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / 20040324-1.c
blobbe718aba692a7c365056cd03a8009e08aa7ea977
1 /* { dg-do run } */
2 /* { dg-options "-O2" } */
4 /* Ensure that BIT_FIELD_REFs gets the appropriate VUSE.
5 Contributed by Paolo Bonzini <bonzini@gnu.org>.
7 This testcase actually never triggered in the CVS repo, but it did
8 in my local tree and it seems worth testing. In this test, the if's
9 are folded to BIT_FIELD_REFs but the VUSEs were erroneously left out.
10 Therefore, DOM did not see that i was modified between the two ifs
11 and optimized away the second if. */
13 extern void abort (void);
14 extern void exit (int);
16 struct x
18 unsigned b:1;
19 unsigned c:1;
22 struct x i = { 1, 1 };
24 int
25 main ()
27 i.b = 1;
28 if (i.b == 1 && i.c == 0)
29 exit (0);
30 i.c = 0;
31 if (i.b == 1 && i.c == 0)
32 exit (0);
33 abort ();