annotate gcc/testsuite/gcc.dg/tree-ssa/recip-3.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile } */
kono
parents:
diff changeset
2 /* { dg-options "-O1 -fno-trapping-math -funsafe-math-optimizations -fdump-tree-recip" } */
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 double F[2] = { 0.0, 0.0 }, e;
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 /* In this case the optimization is interesting. */
kono
parents:
diff changeset
7 float h ()
kono
parents:
diff changeset
8 {
kono
parents:
diff changeset
9 int i;
kono
parents:
diff changeset
10 double E, W, P, d;
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 W = 1.1;
kono
parents:
diff changeset
13 d = 2.*e;
kono
parents:
diff changeset
14 E = 1. - d;
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 for( i=0; i < 2; i++ )
kono
parents:
diff changeset
17 if( d > 0.01 )
kono
parents:
diff changeset
18 {
kono
parents:
diff changeset
19 P = ( W < E ) ? (W - E)/d : (E - W)/d;
kono
parents:
diff changeset
20 F[i] += P;
kono
parents:
diff changeset
21 }
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 F[0] += E / d;
kono
parents:
diff changeset
24 }
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 /* { dg-final { scan-tree-dump-times " / " 1 "recip" } } */