The BSWAP operation is not handled in rtx_costs. Add it. gcc/ChangeLog:
* config/riscv/riscv.c (rtx_costs): Add BSWAP. Signed-off-by: Philipp Tomsich <philipp.toms...@vrull.eu> --- gcc/config/riscv/riscv.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gcc/config/riscv/riscv.c b/gcc/config/riscv/riscv.c index c77b0322869..8480cf09294 100644 --- a/gcc/config/riscv/riscv.c +++ b/gcc/config/riscv/riscv.c @@ -2131,6 +2131,14 @@ riscv_rtx_costs (rtx x, machine_mode mode, int outer_code, int opno ATTRIBUTE_UN *total = riscv_extend_cost (XEXP (x, 0), GET_CODE (x) == ZERO_EXTEND); return false; + case BSWAP: + if (TARGET_ZBB) + { + *total = COSTS_N_INSNS (1); + return true; + } + return false; + case FLOAT: case UNSIGNED_FLOAT: case FIX: -- 2.32.0