https://gcc.gnu.org/g:edd90d6d298f006e2c2e6c710ab97cd5ad733cb5
commit r15-1051-gedd90d6d298f006e2c2e6c710ab97cd5ad733cb5 Author: YunQiang Su <s...@gcc.gnu.org> Date: Thu Jun 6 12:28:31 2024 +0800 MIPS: Need COSTS_N_INSNS in mips_insn_cost In mips_insn_cost, COSTS_N_INSNS is missing when we return the cost if count * ratio > 0. gcc * config/mips/mips.cc(mips_insn_cost): Add missing COSTS_N_INSNS to count. Diff: --- gcc/config/mips/mips.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/mips/mips.cc b/gcc/config/mips/mips.cc index b478cddc8ad..278d9446482 100644 --- a/gcc/config/mips/mips.cc +++ b/gcc/config/mips/mips.cc @@ -4199,7 +4199,7 @@ mips_insn_cost (rtx_insn *x, bool speed) count = get_attr_insn_count (x); ratio = get_attr_perf_ratio (x); - cost = count * ratio; + cost = COSTS_N_INSNS (count) * ratio; if (cost > 0) return cost;