PR tree-optimization/33562
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / negate.c
blobad61bc6507809c622e6be20b6673cb22b72c9b1c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-reassoc1" } */
4 int f (int a, int b)
6 int x = -a;
7 int y = b - x;
8 return y;
11 /* We tested for reassociation to -(a + b) on the following which
12 isn't a transform that makes things cheaper. With reassoc
13 no longer applying to types with undefined overflow we lost
14 this transform.
16 int g (int a, int b)
18 int x = -a;
19 int y = x - b;
20 return y;
25 /* There should be an addition now. */
26 /* { dg-final { scan-tree-dump-times "\\+" 1 "reassoc1"} } */