OSDN Git Service

43abc81c81c875f27448c444117c20ad7fa516a5
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / tree-ssa / pr20913.c
1 /* PR tree-optimization/20913
2    COPY-PROP did not fold COND_EXPR, blocking some copy propagation
3    opportunities.  */
4
5 /* { dg-do compile } */
6 /* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-copyprop1-details" } */
7
8 int
9 foo (int a, int b, int c, int d)
10 {
11   int x, y;
12
13   b = a;
14   if (a == b)
15     x = c;
16   else
17     x = d;
18
19   if (x == c)
20     return a;
21   else
22     return b;
23 }
24
25 /* { dg-final { scan-tree-dump-times "with if \\(1\\)" 2 "copyprop1"} } */
26 /* { dg-final { cleanup-tree-dump "copyprop1" } } */