Merge from mainline
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / recip-4.c
blob20d7681d28d57f2a8b18ba5e432714f7467df336
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fno-trapping-math -funsafe-math-optimizations -fdump-tree-recip" } */
4 /* based on the test case in pr23109 */
6 double F[2] = { 0., 0. }, e = 0.;
8 /* Nope, we cannot prove the optimization is worthwhile in this case. */
9 void f ()
11 int i;
12 double E, W, P, d;
14 W = 1.;
15 d = 2.*e;
16 E = 1. - d;
18 if( d > 0.01 )
20 P = ( W < E ) ? (W - E)/d : (E - W)/d;
21 F[i] += P;
25 /* We also cannot prove the optimization is worthwhile in this case. */
26 float g ()
28 int i;
29 double E, W, P, d;
31 W = 1.;
32 d = 2.*e;
33 E = 1. - d;
35 if( d > 0.01 )
37 P = ( W < E ) ? (W - E)/d : (E - W)/d;
38 F[i] += P;
41 return 1.0 / d;
44 /* { dg-final { scan-tree-dump-not "reciptmp" "recip" } } */
45 /* { dg-final { cleanup-tree-dump "recip" } } */