https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94740

--- Comment #3 from Peter Bergner <bergner at gcc dot gnu.org> ---
Here's a simpler test case that fails the same way:

int array[8];
int
foo (void)
{
  return __builtin_bswap32 (array[1]);
}

So before CSE, we have:

(insn 5 2 6 2 (set (reg/f:DI 121)
                   (symbol_ref:DI ("*.LANCHOR0") [flags 0x182]))
{*pcrel_local_addr})
(insn 6 5 7 2 (set (reg:DI 123)
                   (const_int 4 [0x4])) {*movdi_internal64})
(insn 7 6 8 2 (set (reg:SI 122)
                   (bswap:SI (mem/c:SI (plus:DI (reg/f:DI 121)
                                                (reg:DI 123)))))
{bswapsi2_load}
     (expr_list:REG_EQUAL (bswap:SI (mem/c:SI (plus:DI (reg/f:DI 121)
                    (const_int 4 [0x4]))))))
...

After CSE, we then have all the way up to LRA:
(insn 7 9 14 2 (set (reg:SI 122)
                    (bswap:SI (mem/c:SI (plus:DI (symbol_ref:DI ("*.LANCHOR0")
[flags 0x182])
                    (const_int 4))))) {bswapsi2_load})
...

LRA then calls decompse_address with the above address, which causes us to go
sideways.  Not sure why yet.  Maybe our bswap2_load pattern needs help?

Reply via email to