https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104632
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Last reconfirmed| |2022-02-22
Status|UNCONFIRMED |NEW
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
The bswap pass is supposed to handle these but has
bool
find_bswap_or_nop_load (gimple *stmt, tree ref, struct symbolic_number *n)
{
...
/* Avoid returning a negative bitpos as this may wreak havoc later. */
if (maybe_lt (bit_offset, 0))
{
commenting the code produces the desired
load_le32_backwards:
.LFB0:
.cfi_startproc
movl -4(%rdi), %eax
ret
the code is present since the introduction of memory source to the bswap pass.
It needs to be investigated what exactly the "havoc" is but clearly the "havoc"
should be mitigated closer to the offenders since the above case seems to work
just fine.