]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Remove blanket else in riscv_hard_regno_mode_ok.
authorRobin Dapp <rdapp@oss.qualcomm.com>
Thu, 26 Mar 2026 15:09:11 +0000 (16:09 +0100)
committerRobin Dapp <robin.dapp@oss.qualcomm.com>
Mon, 18 May 2026 10:01:39 +0000 (12:01 +0200)
While looking at PR124439 I noticed that we have unreachable code in
riscv_hard_regno_mode_ok.  Right now we just return false for registers
that don't match one of the first four if conditions.

This patch just removes the else.

gcc/ChangeLog:

* config/riscv/riscv.cc (riscv_hard_regno_mode_ok): Remove else.

gcc/config/riscv/riscv.cc

index 0fbc94297ca5e8661cac7a9aa793b770066a25ee..9a0b5c296d9158d4792262db5792be3b5a7b6f1f 100644 (file)
@@ -10960,8 +10960,6 @@ riscv_hard_regno_mode_ok (unsigned int regno, machine_mode mode)
   else if (VTYPE_REG_P (regno) || VL_REG_P (regno) || VXRM_REG_P (regno)
           || FRM_REG_P (regno))
     return true;
-  else
-    return false;
 
   /* Require same callee-savedness for all registers.  */
   for (unsigned i = 1; i < nregs; i++)