Be careful about comdat boundary in ICF (PR ipa/82352).
[official-gcc.git] / gcc / testsuite / g++.dg / opt / pr51596.C
blob2ed94812de3b05aa0f9e7e9add8b5e4f6d76e7dd
1 // PR tree-optimization/51596
2 // { dg-do compile }
3 // { dg-options "-O -fnon-call-exceptions" }
5 struct A { float v[2]; };
6 struct B { int v[2]; };
8 struct C
10   B c;
11   C f ()
12   {
13     B b;
14     for (int i = 0; i < 2; i++)
15       b.v[i] = c.v[i];
16     return *this;
17   }
20 struct D
22   A d;
23   D (B x)
24   {
25     for (int i = 0; i < 2; i++)
26       d.v[i] = x.v[i];
27   }
30 int bar ();
32 C i;
34 void
35 foo ()
37   while (bar ())
38     D (i.f ().c);