aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-06-26 10:33:12 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-06-26 10:33:12 +0000
commit75f0112f1bb9b671ff4679ec6802bf1cee6696c0 (patch)
tree6aa64a005590567f446a5ee63fd6607828b8e23e
parent3e2becc495c2ed8e48b055707430c8204826d7bf (diff)
downloadgcc-75f0112f1bb9b671ff4679ec6802bf1cee6696c0.zip
gcc-75f0112f1bb9b671ff4679ec6802bf1cee6696c0.tar.gz
gcc-75f0112f1bb9b671ff4679ec6802bf1cee6696c0.tar.bz2
re PR tree-optimization/81203 (tail recursion: internal compiler error: verify_ssa failed)
2017-06-26 Richard Biener <rguenther@suse.de> PR tree-optimization/81203 * tree-tailcall.c (find_tail_calls): Do not move stmts into non-dominating BBs. * gcc.dg/torture/pr81203.c: New testcase. From-SVN: r249644
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr81203.c10
-rw-r--r--gcc/tree-tailcall.c5
4 files changed, 26 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 41d5f57..27ed3f9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2017-06-26 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/81203
+ * tree-tailcall.c (find_tail_calls): Do not move stmts into
+ non-dominating BBs.
+
2017-06-26 Marek Polacek <polacek@redhat.com>
PR c/80116
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0a5b8a8..9f9c123 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2017-06-26 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/81203
+ * gcc.dg/torture/pr81203.c: New testcase.
+
2017-06-26 Marek Polacek <polacek@redhat.com>
PR c/80116
diff --git a/gcc/testsuite/gcc.dg/torture/pr81203.c b/gcc/testsuite/gcc.dg/torture/pr81203.c
new file mode 100644
index 0000000..5c9eaf5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr81203.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+
+int a;
+int b()
+{
+ int c, d;
+ if (a)
+ d = b();
+ return 1 + c + d;
+}
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c
index 6aa9a56..e0497e5 100644
--- a/gcc/tree-tailcall.c
+++ b/gcc/tree-tailcall.c
@@ -573,6 +573,11 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
{
if (! tail_recursion)
return;
+ /* Do not deal with checking dominance, the real fix is to
+ do path isolation for the transform phase anyway, removing
+ the need to compute the accumulators with new stmts. */
+ if (abb != bb)
+ return;
for (unsigned opno = 1; opno < gimple_num_ops (stmt); ++opno)
{
tree op = gimple_op (stmt, opno);