https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91386
Wilco <wilco at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wilco at gcc dot gnu.org --- Comment #12 from Wilco <wilco at gcc dot gnu.org> --- (In reply to Martin Liška from comment #10) > I'm attaching all tree and rtl dumps for the problematic LTRANS unit: > https://drive.google.com/file/d/1CW4cWvpm1VVXFIP80XCf1IzYXWwTsynZ/ > view?usp=sharing > > I can confirm what Andreas sees: > > (note 8303 8031 7890 4 NOTE_INSN_PROLOGUE_END) > (insn:TI 7890 8303 7889 4 (set (mem/c:DI (plus:DI (reg/f:DI 31 sp) > (const_int 704 [0x2c0])) [63 %sfp+-2912 S8 A64]) > (reg/f:DI 2 x2 [1833])) "../include/list.h":29:13 47 {*movdi_aarch64} > (nil)) > (insn 7889 7890 7887 4 (set (mem/c:DI (plus:DI (reg/f:DI 31 sp) > (const_int 712 [0x2c8])) [63 %sfp+-2904 S8 A64]) > (reg/f:DI 3 x3 [1834])) "../include/list.h":29:13 47 {*movdi_aarch64} > (nil)) > > gets transformed by peephole2 to: > (note 8303 8031 8556 4 NOTE_INSN_PROLOGUE_END) > (insn 8556 8303 7887 4 (parallel [ > (set (mem/c:DI (plus:DI (reg:DI 7 x7) > (const_int 8 [0x8])) [63 %sfp+-2912 S8 A64]) > (reg/f:DI 2 x2 [1833])) > (set (mem/c:DI (plus:DI (reg:DI 7 x7) > (const_int 16 [0x10])) [63 %sfp+-2904 S8 A64]) > (reg/f:DI 3 x3 [1834])) > ]) "../include/list.h":29:13 -1 > (nil)) > > I don't know what's the meaning of x7 register, but it's not set during main > function execution. Basically the backend can combine up to 4 loads or stores and insert an addressing instruction so that all offsets are in range (aarch64_gen_adjusted_ldpstp). It appears a later optimization removes the initialization of x7 as dead and so the address is wrong. The key question is how does one dump rtl with -flto? It doesn't work at all, making debugging this difficult...