re PR tree-optimization/87117 (ICE in eliminate_dom_walker::eliminate_cleanup(bool...
authorRichard Biener <rguenther@suse.de>
Tue, 28 Aug 2018 09:33:16 +0000 (09:33 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 28 Aug 2018 09:33:16 +0000 (09:33 +0000)
2018-08-28  Richard Biener  <rguenther@suse.de>

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

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/lvalue-5.c
gcc/tree-ssa-operands.c

index 3324243..b8c25ba 100644 (file)
@@ -1,3 +1,10 @@
+2018-08-28  Richard Biener  <rguenther@suse.de>
+
+       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  <mliska@suse.cz>
 
        * tree.h: Update documentation of fndecl_built_in_p
index 6d85561..ddd365e 100644 (file)
@@ -1,3 +1,8 @@
+2018-08-28  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/87117
+       * gcc.dg/lvalue-5.c: New testcase.
+
 2018-08-27  Jeff Law  <law@redhat.com>
 
        PR tree-optimization/87110
index 514f35e..ff3598a 100644 (file)
@@ -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)
index eefe270..7bff676 100644 (file)
@@ -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;