1 /* { dg-do compile } */
2 /* { dg-require-effective-target int32 } */
3 /* { dg-options "-O2 -fdump-tree-pre-details" } */
4
5 int f;
6 int g;
7 unsigned int
foo(int b,int x)8 foo (int b, int x)
9 {
10 if (b)
11 x = *(int *)&f;
12 g = x;
13 return *(unsigned int*)&f;
14 }
15 float
bar(int b,int x)16 bar (int b, int x)
17 {
18 if (b)
19 x = *(int *)&f;
20 g = x;
21 return *(float *)&f;
22 }
23
24 /* We should see the partial redundant loads of f even though they
25 are using different types (of the same size). */
26
27 /* { dg-final { scan-tree-dump-times "Replaced MEM" 2 "pre" } } */
28