diff options
author | Richard Biener <rguenther@suse.de> | 2017-02-28 15:32:24 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2017-02-28 15:32:24 +0000 |
commit | 41aa3a38572bd643ae958fb23a9fad87cdddd9bb (patch) | |
tree | dbbfdd34b9627de77f02682c0884df4ffbfa6a56 /gcc/tree-ssa-pre.c | |
parent | 587240d2494dae65fd67d5bd642a6123ecc89738 (diff) | |
download | gcc-41aa3a38572bd643ae958fb23a9fad87cdddd9bb.zip gcc-41aa3a38572bd643ae958fb23a9fad87cdddd9bb.tar.gz gcc-41aa3a38572bd643ae958fb23a9fad87cdddd9bb.tar.bz2 |
re PR tree-optimization/79740 (ICE on -Os and above in both 32-bit and 64-bit modes on x86_64-linux-gnu (internal compiler error: in VN_INFO_GET, at tree-ssa-sccvn.c:407 }))
2017-02-28 Richard Biener <rguenther@suse.de>
PR tree-optimization/79740
* tree-ssa-sccvn.c (vn_nary_op_insert_into): Allow redundant
inserts.
(visit_nary_op): Insert the nary into the hashtable if we
pattern-matched sth.
* tree-ssa-pre.c (eliminate_insert): Robustify.
* gcc.dg/torture/pr79740.c: New testcase.
From-SVN: r245780
Diffstat (limited to 'gcc/tree-ssa-pre.c')
-rw-r--r-- | gcc/tree-ssa-pre.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index a1d7677..bdf48ad7 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -4099,8 +4099,12 @@ eliminate_push_avail (tree op) static tree eliminate_insert (gimple_stmt_iterator *gsi, tree val) { - gimple *stmt = gimple_seq_first_stmt (VN_INFO (val)->expr); - if (!is_gimple_assign (stmt) + /* We can insert a sequence with a single assignment only. */ + gimple_seq stmts = VN_INFO (val)->expr; + if (!gimple_seq_singleton_p (stmts)) + return NULL_TREE; + gassign *stmt = dyn_cast <gassign *> (gimple_seq_first_stmt (stmts)); + if (!stmt || (!CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt)) && gimple_assign_rhs_code (stmt) != VIEW_CONVERT_EXPR && gimple_assign_rhs_code (stmt) != BIT_FIELD_REF @@ -4116,8 +4120,8 @@ eliminate_insert (gimple_stmt_iterator *gsi, tree val) if (!leader) return NULL_TREE; - gimple_seq stmts = NULL; tree res; + stmts = NULL; if (gimple_assign_rhs_code (stmt) == BIT_FIELD_REF) res = gimple_build (&stmts, BIT_FIELD_REF, TREE_TYPE (val), leader, |