]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR tree-optimization/56539 (ICE: verify_ssa failed: caused by -foptimize...
authorJakub Jelinek <jakub@redhat.com>
Wed, 3 Apr 2013 08:22:12 +0000 (10:22 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 3 Apr 2013 08:22:12 +0000 (10:22 +0200)
Backported from mainline
2013-03-06  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/56539
* tree-tailcall.c (adjust_return_value_with_ops): Use GSI_SAME_STMT
instead of GSI_CONTINUE_LINKING as last argument to
force_gimple_operand_gsi.  Adjust function comment.

* gcc.c-torture/compile/pr56539.c: New test.

From-SVN: r197392

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr56539.c [new file with mode: 0644]
gcc/tree-tailcall.c

index fb06ec2726a6029cfb62e08e222dd6b88a6752b2..d9a748fda160159be660b7a61f63bc542c466eea 100644 (file)
@@ -1,6 +1,13 @@
 2013-04-03  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
+       2013-03-06  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/56539
+       * tree-tailcall.c (adjust_return_value_with_ops): Use GSI_SAME_STMT
+       instead of GSI_CONTINUE_LINKING as last argument to
+       force_gimple_operand_gsi.  Adjust function comment.
+
        2013-03-05  Jakub Jelinek  <jakub@redhat.com>
 
        PR debug/56510
index 59e9857c47816cee9dbfd6f74db5f88a32f1b5f9..a7ec289ee295dc41c6ad485edfe7fa5de7f6044b 100644 (file)
@@ -1,6 +1,11 @@
 2013-04-03  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
+       2013-03-06  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/56539
+       * gcc.c-torture/compile/pr56539.c: New test.
+
        2013-03-05  Jakub Jelinek  <jakub@redhat.com>
 
        PR debug/56510
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr56539.c b/gcc/testsuite/gcc.c-torture/compile/pr56539.c
new file mode 100644 (file)
index 0000000..0fba96f
--- /dev/null
@@ -0,0 +1,7 @@
+/* PR tree-optimization/56539 */
+
+short
+foo (const char *x, unsigned y)
+{
+  return y > 1 ? (x[y - 1] - '0') + 10 * foo (x, y - 1) : (*x - '0');
+}
index 02e1113f4832a0bd4991e81698be6755047c59e4..66fb89252c4756db09117b57eb513ef7aab380a8 100644 (file)
@@ -601,8 +601,8 @@ add_successor_phi_arg (edge e, tree var, tree phi_arg)
 }
 
 /* Creates a GIMPLE statement which computes the operation specified by
-   CODE, OP0 and OP1 to a new variable with name LABEL and inserts the
-   statement in the position specified by GSI and UPDATE.  Returns the
+   CODE, ACC and OP1 to a new variable with name LABEL and inserts the
+   statement in the position specified by GSI.  Returns the
    tree node of the statement's result.  */
 
 static tree
@@ -627,7 +627,7 @@ adjust_return_value_with_ops (enum tree_code code, const char *label,
                                            fold_convert (TREE_TYPE (op1), acc),
                                            op1));
       rhs = force_gimple_operand_gsi (&gsi, rhs,
-                                     false, NULL, true, GSI_CONTINUE_LINKING);
+                                     false, NULL, true, GSI_SAME_STMT);
       stmt = gimple_build_assign (NULL_TREE, rhs);
     }