OSDN Git Service

2012-01-30 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / tree-ssa / pr49039.c
1 /* PR tree-optimization/49039 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fdump-tree-vrp1" } */
4
5 extern void bar (void);
6
7 void
8 foo (unsigned int x, unsigned int y)
9 {
10   unsigned int minv, maxv;
11   if (x >= 3 && x <= 6)
12     return;
13   if (y >= 5 && y <= 8)
14     return;
15   minv = x < y ? x : y;
16   maxv = x > y ? x : y;
17   if (minv == 5)
18     bar ();
19   if (minv == 6)
20     bar ();
21   if (maxv == 5)
22     bar ();
23   if (maxv == 6)
24     bar ();
25 }
26
27 /* { dg-final { scan-tree-dump "Folding predicate minv_\[0-9\]* == 5 to 0" "vrp1" } } */
28 /* { dg-final { scan-tree-dump "Folding predicate minv_\[0-9\]* == 6 to 0" "vrp1" } } */
29 /* { dg-final { scan-tree-dump "Folding predicate maxv_\[0-9\]* == 5 to 0" "vrp1" } } */
30 /* { dg-final { scan-tree-dump "Folding predicate maxv_\[0-9\]* == 6 to 0" "vrp1" } } */
31 /* { dg-final { cleanup-tree-dump "vrp1" } } */