Merge reload-branch up to revision 101000
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / reassoc-1.c
blobb9cdff36285f901e42dbf18456ce0ff52a983fbb
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
3 int a, b, c, d;
4 extern int printf (const char *, ...);
5 int main(void)
7 int e;
8 int f;
9 /* We should 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 ("%d %d\n", e, f);
17 /* { dg-final { scan-tree-dump-times "a \\\+ b" 1 "optimized"} } */
18 /* { dg-final { cleanup-tree-dump "optimized" } } */