From: Richard Biener Date: Tue, 28 Aug 2018 09:33:16 +0000 (+0000) Subject: re PR tree-optimization/87117 (ICE in eliminate_dom_walker::eliminate_cleanup(bool... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6df46f59d3bb38f31c6f7a5e06231944d18fa4dc;p=gcc.git re PR tree-optimization/87117 (ICE in eliminate_dom_walker::eliminate_cleanup(bool) at gcc/gcc/tree-ssa-sccvn.c:5431 since r263875) 2018-08-28 Richard Biener PR tree-optimization/87117 * tree-ssa-operands.c (add_stmt_operand): STRING_CST may get virtual operands. (get_expr_operands): Handle STRING_CST like other decls. * gcc.dg/lvalue-5.c: New testcase. From-SVN: r263908 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 33242431ac0..b8c25ba6ea7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-08-28 Richard Biener + + PR tree-optimization/87117 + * tree-ssa-operands.c (add_stmt_operand): STRING_CST may + get virtual operands. + (get_expr_operands): Handle STRING_CST like other decls. + 2018-08-28 Martin Liska * tree.h: Update documentation of fndecl_built_in_p diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6d85561ef83..ddd365ecade 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-08-28 Richard Biener + + PR tree-optimization/87117 + * gcc.dg/lvalue-5.c: New testcase. + 2018-08-27 Jeff Law PR tree-optimization/87110 diff --git a/gcc/testsuite/gcc.dg/lvalue-5.c b/gcc/testsuite/gcc.dg/lvalue-5.c index 514f35ed802..ff3598ae8a7 100644 --- a/gcc/testsuite/gcc.dg/lvalue-5.c +++ b/gcc/testsuite/gcc.dg/lvalue-5.c @@ -1,7 +1,7 @@ /* Test assignment to elements of a string literal is a warning, not an error. PR 27676. */ /* { dg-do compile } */ -/* { dg-options "-pedantic-errors" } */ +/* { dg-options "-O -pedantic-errors" } */ void f (void) diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c index eefe270c32d..7bff676cf52 100644 --- a/gcc/tree-ssa-operands.c +++ b/gcc/tree-ssa-operands.c @@ -515,7 +515,7 @@ add_stmt_operand (struct function *fn, tree *var_p, gimple *stmt, int flags) { tree var = *var_p; - gcc_assert (SSA_VAR_P (*var_p)); + gcc_assert (SSA_VAR_P (*var_p) || TREE_CODE (*var_p) == STRING_CST); if (is_gimple_reg (var)) { @@ -740,6 +740,7 @@ get_expr_operands (struct function *fn, gimple *stmt, tree *expr_p, int flags) case VAR_DECL: case PARM_DECL: case RESULT_DECL: + case STRING_CST: if (!(flags & opf_address_taken)) add_stmt_operand (fn, expr_p, stmt, flags); return;