Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr22026.c
blob3a89608b52601b02e8607f4daa655fc2314b6d55
1 /* PR tree-optimization/22026
2 VRP used think that ~[0,0] + ~[0,0] = ~[0,0], which is wrong. The
3 same applies to subtraction and unsigned multiplication. */
5 /* { dg-do compile } */
6 /* { dg-options "-O2 -fdump-tree-vrp1" } */
8 int
9 plus (int x, int y)
11 if (x != 0)
12 if (y != 0)
14 int z = x + y;
15 if (z != 0)
16 return 1;
18 return 0;
21 int
22 minus (int x, int y)
24 if (x != 0)
25 if (y != 0)
27 int z = x - y;
28 if (z != 0)
29 return 1;
31 return 0;
34 int
35 mult (unsigned x, unsigned y)
37 if (x != 0)
38 if (y != 0)
40 unsigned z = x * y;
41 if (z != 0)
42 return 1;
44 return 0;
47 /* None of the predicates can be folded in these functions. */
48 /* { dg-final { scan-tree-dump-times "Folding predicate" 0 "vrp1" } } */