gcc/
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / reassoc-4.c
blob8f9de464e8d3dc4742338a12d6f0902fdef4cfd5
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized -ffast-math" } */
3 float a, b, c, d;
4 extern int printf (const char *, ...);
5 int main(void)
7 float e;
8 float f;
9 /* We should not be able to transform these into the same expression, and only have two additions. */
10 e = a + b;
11 e = e + c;
12 f = c + a;
13 f = f + b;
14 printf ("%f %f\n", e, f);
17 /* { dg-final { scan-tree-dump-times "\\\+" 2 "optimized"} } */
18 /* { dg-final { cleanup-tree-dump "optimized" } } */