https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114252
--- Comment #3 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #1)
> but somehow we end up doing a libcall?
It's not a libcall in the GCC sense, for the compiler it's just an ordinary
insn. The backend then prints this as a transparent call to libgcc.
Purpose is that many functions have a small, known footprint as they are
implemented in assembly. An ordinary call would clobber all callee-used regs,
so using a transparent call gives better code than a real call. Notice this is
the nsn:
(define_insn "*bswapsi2.libgcc"
[(set (reg:SI 22)
(bswap:SI (reg:SI 22)))
(clobber (reg:CC REG_CC))]
"reload_completed"
"%~call __bswapsi2"
[(set_attr "type" "xcall")])
However, for the purpose of this PR, no bswap is needed in the 1st place; just
have a look at the v13 code. It just loads the bytes as they belong into the
target value; while v14 loads all 32 bits in one chunk and then starts fiddling
and moving around the constituent bytes.