From db810ebc8e3f98c20375b01c09b5b5bd8ac842f7 Mon Sep 17 00:00:00 2001 From: wschmidt Date: Fri, 25 May 2018 19:12:16 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@260772 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/gimple-ssa-strength-reduction.c | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a1ef11eecac..aef4d9aa827 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 a4e5a52836c..b86ce858dc2 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.11.4.GIT