From 9d502741aa65321078d059865865bdc93af445b6 Mon Sep 17 00:00:00 2001 From: Bill Schmidt Date: Fri, 25 May 2018 19:12:16 +0000 Subject: [PATCH] re PR tree-optimization/85712 (ICE in all_phi_incrs_profitable_1 at gcc/gimple-ssa-strength-reduction.c:3479) 2018-05-25 Bill Schmidt PR tree-optimization/85712 * gimple-ssa-strength-reduction.c (replace_one_candidate): Skip if this candidate has already been replaced in-situ by a copy. From-SVN: r260772 --- gcc/ChangeLog | 6 ++++++ gcc/gimple-ssa-strength-reduction.c | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a1ef11e..aef4d9a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-05-25 Bill Schmidt + + PR tree-optimization/85712 + * gimple-ssa-strength-reduction.c (replace_one_candidate): Skip if + this candidate has already been replaced in-situ by a copy. + 2018-05-25 Jason Merrill PR c++/80485 - inline function non-zero address. diff --git a/gcc/gimple-ssa-strength-reduction.c b/gcc/gimple-ssa-strength-reduction.c index a4e5a52..b86ce85 100644 --- a/gcc/gimple-ssa-strength-reduction.c +++ b/gcc/gimple-ssa-strength-reduction.c @@ -3662,6 +3662,11 @@ replace_one_candidate (slsr_cand_t c, unsigned i, tree basis_name) orig_rhs2 = gimple_assign_rhs2 (c->cand_stmt); cand_incr = cand_increment (c); + /* If orig_rhs2 is NULL, we have already replaced this in situ with + a copy statement under another interpretation. */ + if (!orig_rhs2) + return; + if (dump_file && (dump_flags & TDF_DETAILS)) { fputs ("Replacing: ", dump_file); -- 2.7.4