https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106600
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Andrew Pinski <pins...@gcc.gnu.org>: https://gcc.gnu.org/g:cb2daf5acce003300ee948a89860c0d13ebcae79 commit r13-2178-gcb2daf5acce003300ee948a89860c0d13ebcae79 Author: Andrew Pinski <apin...@marvell.com> Date: Fri Aug 19 17:01:02 2022 +0000 Fix PR 106600: __builtin_bswap32 is not hooked up for ZBB for 32bit The problem here is the bswap<mode>2 pattern had a check for TARGET_64BIT but then used the X iterator. Since the X iterator is either SI or DI depending on the setting TARGET_64BIT, there is no reason for the TARGET_64BIT. OK? Built and tested on both riscv32-linux-gnu and riscv64-linux-gnu. Thanks, Andrew Pinski gcc/ChangeLog: PR target/106600 * config/riscv/bitmanip.md (bswap<mode>2): Remove condition on TARGET_64BIT as X is already conditional there. gcc/testsuite/ChangeLog: PR target/106600 * gcc.target/riscv/zbb_32_bswap-1.c: New test. * gcc.target/riscv/zbb_bswap-1.c: New test.