https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124900
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Kito Cheng <[email protected]>: https://gcc.gnu.org/g:f74150ec28282824b0a9bd298b87210e880ddec3 commit r17-3495-gf74150ec28282824b0a9bd298b87210e880ddec3 Author: Jojo R <[email protected]> Date: Wed Aug 19 15:01:51 2026 +0800 RISC-V: Reject table-based CRC optabs for size The profitability check added for PR middle-end/124900 asks the target whether a CRC optab is suitable for both speed and size. The RISC-V reversed CRC optab is always present, however, and falls back to a 256-entry lookup table when CLMUL expansion is unavailable. This allows the transformation under -Os and -Oz even though it significantly increases code size. Implement TARGET_OPTAB_SUPPORTED_P for crc_rev_optab. Keep the table fallback available when optimizing for speed, but report the optab as suitable for both speed and size only when Zbc, Zbkc, or Zvbc can provide the CLMUL expansion and the result mode is narrower than word_mode. Add an RV32/RV64 regression test for the no-CLMUL -Os and -Oz paths. gcc/ChangeLog: * config/riscv/riscv.cc (riscv_optab_supported_p): New function. (TARGET_OPTAB_SUPPORTED_P): Define. gcc/testsuite/ChangeLog: * gcc.target/riscv/crc-size-no-table.c: New test.
