2018-05-17 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-pre-30.c
blob59af63ad5aca696b42cdbddf3d32a84f527683e5
1 /* { dg-do compile } */
2 /* { dg-require-effective-target int32 } */
3 /* { dg-options "-O2 -fdump-tree-pre-details" } */
5 int f;
6 int g;
7 unsigned int
8 foo (int b, int x)
10 if (b)
11 x = *(int *)&f;
12 g = x;
13 return *(unsigned int*)&f;
15 float
16 bar (int b, int x)
18 if (b)
19 x = *(int *)&f;
20 g = x;
21 return *(float *)&f;
24 /* We should see the partial redundant loads of f even though they
25 are using different types (of the same size). */
27 /* { dg-final { scan-tree-dump-times "Replaced MEM" 2 "pre" } } */