https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106600
Bug ID: 106600 Summary: __builtin_bswap32 is not hooked up for ZBB Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: target Assignee: pinskia at gcc dot gnu.org Reporter: pinskia at gcc dot gnu.org Target Milestone: --- Target: riscv32 Testcase: ``` int f(int a) { return __builtin_bswap32(a); } ``` The reason is because the check for TARGET_64BIT is there even though it should not be: (define_insn "bswap<mode>2" [(set (match_operand:X 0 "register_operand" "=r") (bswap:X (match_operand:X 1 "register_operand" "r")))] "TARGET_64BIT && TARGET_ZBB" "rev8\t%0,%1" [(set_attr "type" "bitmanip")])