Hi,

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.

Regtested on rv64gcv_zvl512b, waiting for the CI.

Regards
 Robin

gcc/ChangeLog:

        * config/riscv/riscv.cc (riscv_hard_regno_mode_ok): Remove else.
---
 gcc/config/riscv/riscv.cc | 2 --
 1 file changed, 2 deletions(-)

diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index 2d56e605bba..229eae78b14 100644
--- a/gcc/config/riscv/riscv.cc
+++ b/gcc/config/riscv/riscv.cc
@@ -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++)
-- 
2.53.0

Reply via email to