On Mon, May 07, 2007 at 10:12:21PM +0200, Paolo Bonzini wrote: > Eric Botcazou wrote: > >> It isn't until the loop2_done dump that the problem shows up. > >>delete_trivially_dead_insns() is called. It calls dead_libcall_p() on insn > >>62 and seeing both the REQ_EQUAL and the REG_RETVAL note and successfully > >>replacing reg 92 with const_int 0, determines that the while libcall > >>sequence 63-152-61-62 is dead and can be deleted, without ever checking > >>insns 63, 152 or 61 for liveness. > > > >Because it's the semantics of libcall sequences. My take is that the > >lower subreg pass breaks it in this case.
I could "fix" it at -O2 with -fno-split-wide-types or at -O1 with -fno-move-loop-invariants or -fno-split-wide-types. > Can you also check -fno-forward-propagate? Yes. It'll have to wait until Wednesday, though. To be able to continue testing, I worked around it like this: Index: gcc/cse.c =================================================================== --- gcc/cse.c (revision 124334) +++ gcc/cse.c (working copy) @@ -4983,8 +4983,11 @@ cse_insn (rtx insn, rtx libcall_insn) && GET_CODE (XEXP (XEXP (src_const, 0), 0)) == LABEL_REF && GET_CODE (XEXP (XEXP (src_const, 0), 1)) == LABEL_REF)) { - /* We only want a REG_EQUAL note if src_const != src. */ - if (! rtx_equal_p (src, src_const)) + /* We only want a REG_EQUAL note if src_const != src. Don't add one + if the insn has a REG_RETVAL note since this will confuse + delete_trivially_dead_insns() (see dead_libcall_p()). */ + if (!rtx_equal_p (src, src_const) + && !find_reg_note (insn, REG_RETVAL, NULL)) { /* Make sure that the rtx is not shared. */ src_const = copy_rtx (src_const); -- Rask Ingemann Lambertsen