| 1 |
/* PR tree-optimization/58791 */ |
| 2 |
/* { dg-do run } */ |
| 3 |
/* { dg-options "-g -ffast-math" } */ |
| 4 |
|
| 5 |
#include "../nop.h" |
| 6 |
|
| 7 |
__attribute__((noinline, noclone)) double |
| 8 |
foo (float a, float b, float c, float d, float l, double u) |
| 9 |
{ |
| 10 |
float e = a * d; |
| 11 |
float f = d * e; |
| 12 |
double g = (double) f; |
| 13 |
double h = (double) b; |
| 14 |
double i = g * h; /* { dg-final { gdb-test pr58791-4.c:32 "i" "486" { target { { i?86-*-* x86_64-*-* } && lp64 } } } } */ |
| 15 |
double i2 = i + 1.0; /* { dg-final { gdb-test pr58791-4.c:32 "i2" "487" { target { { i?86-*-* x86_64-*-* } && lp64 } } } } */ |
| 16 |
double j = i * 3.25; |
| 17 |
double k = h + j; |
| 18 |
float m = l * 8.75; |
| 19 |
double n = (double) m; |
| 20 |
double o = (double) a; |
| 21 |
double p = n * o; |
| 22 |
double q = h * p; |
| 23 |
double r = q * 2.5; |
| 24 |
double s = k - r; |
| 25 |
double t = (double) c; |
| 26 |
double v = o * u; |
| 27 |
double w = o * v; |
| 28 |
double x = h * w; |
| 29 |
double y = h * x; |
| 30 |
double z = y * 8.5; |
| 31 |
asm volatile (NOP : : : "memory"); |
| 32 |
asm volatile (NOP : : : "memory"); |
| 33 |
return s - z; |
| 34 |
} |
| 35 |
|
| 36 |
int |
| 37 |
main () |
| 38 |
{ |
| 39 |
foo (3.0f, 2.0f, -1.0f, 9.0f, 1.0f, 2.0); |
| 40 |
return 0; |
| 41 |
} |