http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57046
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-04-23
12:26:35 UTC ---
We have after the get_value call:
(insn 73 30 32 6 (set (reg:SI 76 [ D.1441 ])
(reg:SI 0 ax)) pr57046.c:42 85 {*movsi_internal}
(expr_list:REG_DEAD (reg:SI 0 ax)
(nil)))
(insn 32 73 33 6 (parallel [
(set (reg:SI 73 [ D.1443 ])
(ashift:SI (subreg:SI (reg:DI 60 [ D.1441 ]) 0)
(const_int 2 [0x2])))
(clobber (reg:CC 17 flags))
]) 502 {*ashlsi3_1}
(expr_list:REG_DEAD (reg:DI 60 [ D.1441 ])
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil))))
and IRA decides to put pseudo 76 into %ebx and pseudo 60 into %ecx. Either it
is an IRA bug, or IRA takes into account that we only really need the low
32-bits of pseudo 60 at that point. In any case, reload loads SImode %ecx from
the stack and uses it in the shift, while LRA loads full DImode %ecx (i.e. %ecx
and %ebx) from the stack, then uses just the low bits from that (i.e. %ecx) in
the shift. So the LRA generated code clobbers the value in %ebx, and get_value
call is even later on DCEd because of it.