From: Bohan Lei Date: Thu, 23 Apr 2026 00:25:22 +0000 (-0600) Subject: [PATCH] RISC-V: Remove redundant CALL_P check X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45032f1ced53a3b07169e15914101dc3af898e46;p=thirdparty%2Fgcc.git [PATCH] RISC-V: Remove redundant CALL_P check Ready for trunk (or gcc-17 since it's stage4 for gcc-16 now)? ------------------------------------------------------------------ From:钟居哲 Send Time:Thu, Jan 8, 2026, 10:51 To:Bohan Lei CC:"gcc-patches"; "pan2.li"; Bohan Lei Subject:Re: [PATCH] RISC-V: Remove redundant CALL_P check LGTM From: "Bohan Lei" Date: Thu, Jan 8, 2026, 10:49 Subject: [PATCH] RISC-V: Remove redundant CALL_P check To: Cc: , , "Bohan Lei" Since we are using `reg_set_p` to check VXRM definition, the `CALL_P` check has become redundant. VXRM is marked as call-used in riscv.h, and `reg_set_p` in `vxrm_unknown_p` should always return true when a call is encountered. gcc/ChangeLog: * config/riscv/riscv.cc (vxrm_unknown_p): Remove `CALL_P` check --- diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc index 8a39c791c26..b9b31b6be2a 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -14026,15 +14026,10 @@ asm_insn_p (rtx_insn *insn) static bool vxrm_unknown_p (rtx_insn *insn) { - /* Return true if there is a definition of VXRM. */ + /* Return true if VXRM is set or clobbered. */ if (reg_set_p (gen_rtx_REG (SImode, VXRM_REGNUM), insn)) return true; - /* A CALL function may contain an instruction that modifies the VXRM, - return true in this situation. */ - if (CALL_P (insn)) - return true; - /* Return true for all assembly since users may hardcode a assembly like this: asm volatile ("csrwi vxrm, 0"). */ if (asm_insn_p (insn))