Merged revisions 208012,208018-208019,208021,208023-208030,208033,208037,208040-20804...
[official-gcc.git] / main / gcc / testsuite / g++.dg / opt / pr60597.C
blobc61f7679765df086a0ef5fcab6e8507d624a1ac1
1 // PR middle-end/60597
2 // { dg-do compile }
3 // { dg-options "-O2 -g" }
5 struct A
7   int foo () const;
8   int bar () const;
9   int a;
12 struct B
14   int foo ();
15   int bar ();
18 int *c, d;
20 int
21 A::foo () const
23   int b = a >> 16;
24   return b;
27 int
28 A::bar () const
30   int b = a;
31   return b;
34 void
35 baz (A &x, B h, int i, int j)
37   for (; i < h.bar (); ++i)
38     for (; h.foo (); ++j)
39       {
40         int g = x.foo ();
41         int f = x.bar ();
42         int e = c[0] & 1;
43         d = (e << 1) | (g << 16) | (f & 1);
44         c[j] = 0;
45       }