https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77937
--- Comment #7 from Bill Schmidt <wschmidt at gcc dot gnu.org> ---
OK, I can reproduce now, and understand the problem better. This patch fixes
the problem. I'll regstrap it and get it committed shortly.
Index: gcc/gimple-ssa-strength-reduction.c
===================================================================
--- gcc/gimple-ssa-strength-reduction.c (revision 240946)
+++ gcc/gimple-ssa-strength-reduction.c (working copy)
@@ -2816,8 +2816,7 @@ analyze_increments (slsr_cand_t first_dep, machine
else if (incr == 0
|| incr == 1
|| (incr == -1
- && (gimple_assign_rhs_code (first_dep->cand_stmt)
- != POINTER_PLUS_EXPR)))
+ && !POINTER_TYPE_P (first_dep->cand_type)))
incr_vec[i].cost = COST_NEUTRAL;
/* FORNOW: If we need to add an initializer, give up if a cast from