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