aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/tree-ssa/pr20920.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/tree-ssa/pr20920.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/tree-ssa/pr20920.C26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-ssa/pr20920.C b/gcc-4.9/gcc/testsuite/g++.dg/tree-ssa/pr20920.C
new file mode 100644
index 000000000..02edd2827
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-ssa/pr20920.C
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+/* This was causing a failure in the out of SSA pass because VRP was
+ trying to insert assertions for SSA names that flow through
+ abnormal edges. */
+void f(int) __attribute__((__noreturn__));
+int d(const char *);
+char * j ();
+
+char *
+foo (int x)
+{
+ char *path = __null;
+ try
+ {
+ path = j ();
+ if (path != __null)
+ if (d (path) != 0)
+ f (127);
+ f (127);
+ }
+ catch (...) { }
+
+ return path;
+}