aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20913.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20913.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20913.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20913.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20913.c
new file mode 100644
index 000000000..fb5461a26
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20913.c
@@ -0,0 +1,34 @@
+/* PR tree-optimization/20913
+ COPY-PROP did not fold COND_EXPR, blocking some copy propagation
+ opportunities. */
+
+/* { dg-do link } */
+/* { dg-options "-O2 -fno-tree-dominator-opts" } */
+
+int
+foo (int a, int b, int c, int d)
+{
+ int x, y;
+
+ b = a;
+ if (a == b)
+ x = c;
+ else
+ {
+ link_error ();
+ x = d;
+ }
+
+ if (x == c)
+ return a;
+ else
+ {
+ link_error ();
+ return b;
+ }
+}
+
+main()
+{
+ foo (1, 2, 3, 4);
+}