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