diff mbox series

[1/2] RISC-V: Fix the outer_code when calculating the cost of SET expression.

Message ID 20240916081056.29251-1-cooper.qu@linux.alibaba.com
State New
Headers show
Series [1/2] RISC-V: Fix the outer_code when calculating the cost of SET expression. | expand

Commit Message

Xianmiao Qu Sept. 16, 2024, 8:10 a.m. UTC
I think it is a typo. When calculating the 'SET_SRC (x)' cost,
outer_code should be set to SET.

gcc/
	* config/riscv/riscv.cc (riscv_rtx_costs): Fix the outer_code
	when calculating the cost of SET expression.
---
 gcc/config/riscv/riscv.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jeff Law Sept. 18, 2024, 1:36 p.m. UTC | #1
On 9/16/24 2:10 AM, Xianmiao Qu wrote:
> I think it is a typo. When calculating the 'SET_SRC (x)' cost,
> outer_code should be set to SET.
> 
> gcc/
> 	* config/riscv/riscv.cc (riscv_rtx_costs): Fix the outer_code
> 	when calculating the cost of SET expression.
Agreed and pushed.

Thanks for finding this.

jeff
diff mbox series

Patch

diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index 6efe14ff199f..1b4a5c39c667 100644
--- a/gcc/config/riscv/riscv.cc
+++ b/gcc/config/riscv/riscv.cc
@@ -3775,7 +3775,7 @@  riscv_rtx_costs (rtx x, machine_mode mode, int outer_code, int opno ATTRIBUTE_UN
 	      *total = COSTS_N_INSNS (1);
 	      return true;
 	    }
-	  riscv_rtx_costs (SET_SRC (x), mode, outer_code, opno, total, speed);
+	  riscv_rtx_costs (SET_SRC (x), mode, SET, opno, total, speed);
 	  return true;
 	}