re PR tree-optimization/33291 (a+=2; a+=2 not simplified to a+=4; with -O3 ...
[gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / 20070302-1.c
1 /* { dg-do link } */
2 /* { dg-options "-O2" } */
3
4 struct A
5 {
6 int x;
7 float y;
8 };
9
10 volatile float X, Y;
11
12 int baz (struct A *z, struct A *y)
13 {
14 z->x = (int) X;
15 z->y = Y;
16 y->x = (int) X;
17 y->y = Y;
18 }
19
20
21 struct A B;
22
23 float foo (int i)
24 {
25 struct A *p, x, y, z;
26
27 p = (i > 10) ? &x : &z;
28 x.y = 3.0;
29 p->x += baz (&z, &y);
30 X = z.y;
31 Y = p->y;
32
33 /* This predicate should always evaluate to false. The call to
34 baz() is not a clobbering site for x.y. The operand scanner was
35 considering it a clobbering site for x.y because x.y is in the
36 alias set of a call-clobbered memory tag. */
37 if (x.y != 3.0)
38 link_error ();
39 }
40
41 main(int argc, char **argv)
42 {
43 foo (argc);
44 }