Merge from trunk @ 138209
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-fre-8.c
blob1494dbbbd94322bf6896dbab90af16dd94388acc
1 /* { dg-do compile } */
2 /* { dg-options "-O -fdump-tree-fre-details" } */
3 #if (__SIZEOF_INT__ == __SIZEOF_FLOAT__)
4 typedef int intflt;
5 #elif (__SIZEOF_LONG__ == __SIZEOF_FLOAT__)
6 typedef long intflt;
7 #else
8 #error Add target support here for type that will union float size
9 #endif
10 union U {
11 intflt i;
12 float f;
14 intflt foo(int i, int b)
16 union U u;
17 if (b)
19 i = i << 2;
20 u.i = i;
21 return u.f;
23 else
25 i = i << 2;
26 u.i = i;
27 return u.f;
31 /* { dg-final { scan-tree-dump-times "Replaced u.f with pretmp" 2 "fre" { xfail *-*-* } } } */
32 /* { dg-final { scan-tree-dump-times "Inserted pretmp" 2 "fre" { xfail *-*-* } } } */
33 /* { dg-final { cleanup-tree-dump "fre" } } */