PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / assoc-1.c
blobf9821910bd01168b49c175cd709e0ff186c954d0
1 /* { dg-do compile } */
2 /* { dg-options "-O -fdump-tree-optimized-raw -fno-tree-reassoc" } */
4 int f0(int a,int b,int c){
5 int d = a + b;
6 int e = c + b;
7 return d - e;
9 int f1(int a,int b,int c){
10 int d = a + b;
11 int e = b - c;
12 return d - e;
14 int f2(int a,int b,int c){
15 int d = a + b;
16 int e = c - b;
17 return e + d;
19 int f3(int a,int b,int c){
20 int d = a - b;
21 int e = c - b;
22 return d - e;
24 int f4(int a,int b,int c){
25 int d = b - a;
26 int e = c - b;
27 return e + d;
30 /* { dg-final { scan-tree-dump-times "plus_expr" 2 "optimized" } } */
31 /* { dg-final { scan-tree-dump-times "minus_expr" 3 "optimized" } } */