https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115910
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
So perhaps that
if (CONSTANT_P (SET_SRC (x)))
/* Constant costs assume a base value of COSTS_N_INSNS (1) and add
a small value, possibly zero for cheap constants. */
src_cost += COSTS_N_INSNS (1);
should be done only for src_cost != 0? Or src_cost < COSTS_N_INSNS (1)?
Or change pattern_cost not to do
return cost > 0 ? cost : COSTS_N_INSNS (1);
but
return cost > COSTS_N_INSNS (1) ? cost : COSTS_N_INSNS (1);
?