re PR tree-optimization/56539 (ICE: verify_ssa failed: caused by -foptimize-sibling...
authorJakub Jelinek <jakub@redhat.com>
Wed, 6 Mar 2013 23:26:42 +0000 (00:26 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 6 Mar 2013 23:26:42 +0000 (00:26 +0100)
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.

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

From-SVN: r196511

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

index caa77ae509a34d6d120ef3f54c215d88d36b7b06..d8e9dee878eb7cc0278cc752d492b9037ea6d863 100644 (file)
@@ -1,5 +1,10 @@
 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.
+
        * config/aarch64/t-aarch64 (TM_H, OPTIONS_H_EXTRA): Add
        aarch64-cores.def.
 
index e2aa7af51c9fe5afd5e5e07a9bee2b7b699084d1..7e6886367798328d838afbb747f7ebddfd9bd5a5 100644 (file)
@@ -1,3 +1,8 @@
+2013-03-06  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/56539
+       * gcc.c-torture/compile/pr56539.c: New test.
+
 2013-03-06  Kai Tietz  <ktietz@redhat.com>
 
        * gcc.dg/lto/20090914-2_0.c: Skip for mingw and cygwin
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 80c0521d831f4a6f30ca4f6d0325d1274aa3cce7..c6581dcedcdb3619970b1a8a1ce56da6863f648f 100644 (file)
@@ -599,8 +599,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
@@ -622,7 +622,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 (result, rhs);
     }