2008-09-22 Richard Guenther <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-fre-7.c
blobbd81831eba82147c593abcea692d19609e00f29c
1 /* { dg-do compile } */
2 /* { dg-options "-O -fdump-tree-fre-details -fdump-tree-optimized" } */
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
11 struct X {
12 int i;
13 union {
14 intflt j;
15 intflt k;
16 float f;
17 } u;
20 intflt foo(intflt j)
22 struct X a;
24 a.u.j = j;
25 a.u.f = a.u.f;
26 a.u.f = a.u.f;
27 a.u.j = a.u.j;
28 a.u.f = a.u.f;
29 return a.u.k;
32 /* { dg-final { scan-tree-dump-times "Inserted pretmp" 1 "fre" } } */
33 /* { dg-final { scan-tree-dump-times "Replaced a.u.f with pretmp" 3 "fre" } } */
34 /* { dg-final { scan-tree-dump-times "Replaced a.u.k with j" 1 "fre" } } */
35 /* { dg-final { scan-tree-dump "= VIEW_CONVERT_EXPR<float>\\\(j_" "fre" } } */
36 /* { dg-final { scan-tree-dump "return j" "optimized" } } */
37 /* { dg-final { cleanup-tree-dump "fre" } } */
38 /* { dg-final { cleanup-tree-dump "optimized" } } */