https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80158
--- Comment #17 from Bill Schmidt <wschmidt at gcc dot gnu.org> --- The following fixes the reduced test case. Could you please test it on the full 416.gamess build? I'll regstrap it on x86-64 and ppc64le. Index: gcc/gimple-ssa-strength-reduction.c =================================================================== --- gcc/gimple-ssa-strength-reduction.c (revision 246419) +++ gcc/gimple-ssa-strength-reduction.c (working copy) @@ -2089,6 +2089,8 @@ replace_mult_candidate (slsr_cand_t c, tree basis_ gimple_set_location (copy_stmt, gimple_location (c->cand_stmt)); gsi_replace (&gsi, copy_stmt, false); c->cand_stmt = copy_stmt; + if (c->next_interp) + lookup_cand (c->next_interp)->cand_stmt = copy_stmt; if (dump_file && (dump_flags & TDF_DETAILS)) stmt_to_print = copy_stmt; } @@ -2118,6 +2120,8 @@ replace_mult_candidate (slsr_cand_t c, tree basis_ basis_name, bump_tree); update_stmt (gsi_stmt (gsi)); c->cand_stmt = gsi_stmt (gsi); + if (c->next_interp) + lookup_cand (c->next_interp)->cand_stmt = gsi_stmt (gsi); if (dump_file && (dump_flags & TDF_DETAILS)) stmt_to_print = gsi_stmt (gsi); } @@ -3405,6 +3409,8 @@ replace_rhs_if_not_dup (enum tree_code new_code, t gimple_assign_set_rhs_with_ops (&gsi, new_code, new_rhs1, new_rhs2); update_stmt (gsi_stmt (gsi)); c->cand_stmt = gsi_stmt (gsi); + if (c->next_interp) + lookup_cand (c->next_interp)->cand_stmt = gsi_stmt (gsi); if (dump_file && (dump_flags & TDF_DETAILS)) return gsi_stmt (gsi); @@ -3511,6 +3517,8 @@ replace_one_candidate (slsr_cand_t c, unsigned i, gimple_assign_set_rhs_with_ops (&gsi, MINUS_EXPR, basis_name, rhs2); update_stmt (gsi_stmt (gsi)); c->cand_stmt = gsi_stmt (gsi); + if (c->next_interp) + lookup_cand (c->next_interp)->cand_stmt = gsi_stmt (gsi); if (dump_file && (dump_flags & TDF_DETAILS)) stmt_to_print = gsi_stmt (gsi); @@ -3532,6 +3540,8 @@ replace_one_candidate (slsr_cand_t c, unsigned i, gimple_set_location (copy_stmt, gimple_location (c->cand_stmt)); gsi_replace (&gsi, copy_stmt, false); c->cand_stmt = copy_stmt; + if (c->next_interp) + lookup_cand (c->next_interp)->cand_stmt = copy_stmt; if (dump_file && (dump_flags & TDF_DETAILS)) stmt_to_print = copy_stmt; @@ -3543,6 +3553,8 @@ replace_one_candidate (slsr_cand_t c, unsigned i, gimple_set_location (cast_stmt, gimple_location (c->cand_stmt)); gsi_replace (&gsi, cast_stmt, false); c->cand_stmt = cast_stmt; + if (c->next_interp) + lookup_cand (c->next_interp)->cand_stmt = cast_stmt; if (dump_file && (dump_flags & TDF_DETAILS)) stmt_to_print = cast_stmt;