From: Jakub Jelinek Date: Wed, 3 Apr 2013 18:05:09 +0000 (+0200) Subject: backport: re PR tree-optimization/56539 (ICE: verify_ssa failed: caused by -foptimize... X-Git-Tag: releases/gcc-4.6.4~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=281ec9583326d06b841c7932697f82ca7c3d86a9;p=thirdparty%2Fgcc.git backport: re PR tree-optimization/56539 (ICE: verify_ssa failed: caused by -foptimize-sibling-calls) Backported from mainline 2013-03-06 Jakub Jelinek 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: r197451 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3ff897fb851c..f5ddc786f7cf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,13 @@ 2013-04-03 Jakub Jelinek Backported from mainline + 2013-03-06 Jakub Jelinek + + 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-01-25 Jakub Jelinek PR tree-optimization/56098 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6b83c2732463..cf1b7c9e199d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,6 +1,11 @@ 2013-04-03 Jakub Jelinek Backported from mainline + 2013-03-06 Jakub Jelinek + + PR tree-optimization/56539 + * gcc.c-torture/compile/pr56539.c: New test. + 2013-02-07 Jakub Jelinek PR c++/56239 diff --git a/gcc/testsuite/gcc.c-torture/compile/pr56539.c b/gcc/testsuite/gcc.c-torture/compile/pr56539.c new file mode 100644 index 000000000000..0fba96f4c8dd --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr56539.c @@ -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'); +} diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c index e50ecc2aa92a..1fc3cd6e1bff 100644 --- a/gcc/tree-tailcall.c +++ b/gcc/tree-tailcall.c @@ -594,8 +594,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 @@ -620,7 +620,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); }