[Bug tree-optimization/89209] [9 Regression] ICE in build_ref_for_model, at tree-sra.c:1791

jamborm at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Feb 5 19:21:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89209

--- Comment #4 from Martin Jambor <jamborm at gcc dot gnu.org> ---
For the record, the following is the most likely fix, but let me think
about it a bit more tomorrow before I submit it.

diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index e4851daaa3f..7efd0a62ebb 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -3548,7 +3548,8 @@ sra_modify_assign (gimple *stmt, gimple_stmt_iterator
*gsi)
              lhs = build_ref_for_model (loc, lhs, 0, racc, gsi, false);
              gimple_assign_set_lhs (stmt, lhs);
            }
-         else if (AGGREGATE_TYPE_P (TREE_TYPE (rhs))
+         else if (lacc
+                  && AGGREGATE_TYPE_P (TREE_TYPE (rhs))
                   && !contains_vce_or_bfcref_p (rhs))
            rhs = build_ref_for_model (loc, rhs, 0, lacc, gsi, false);


More information about the Gcc-bugs mailing list