OSDN Git Service

gcc/testsuite/
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / tree-ssa / recip-2.c
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -funsafe-math-optimizations -fdump-tree-recip" } */
3
4 float e(float a, float b, float c, float d, float e, float f)
5 {
6   if (a < b)
7     {
8       a = a + b;
9       c = c + d;
10     }
11
12   /* The PHI nodes for these divisions should be combined.  */
13   d = d / a;
14   e = e / a;
15   f = f / a;
16   
17   a = a / c;
18   b = b / c;
19
20   /* This should not be left as a multiplication.  */
21   c = 1 / c;
22
23   return a + b + c + d + e + f;
24 }
25
26 /* { dg-final { scan-tree-dump-times " / " 2 "recip" } } */
27 /* { dg-final { scan-tree-dump-times " \\* " 5 "recip" } } */
28 /* { dg-final { cleanup-tree-dump "recip" } } */