On 03/26/2012 06:03 PM, Andreas Schwab wrote: > Bernd Schmidt <ber...@codesourcery.com> writes: > >> Does 4.7 still have the failure at all? > > Yes, see PR52573.
Well, I still think having both REG_DEAD and REG_UNUSED for the same reg is bogus, but fixing that causes trouble in reg-stack. It seems the path of least resistance is to just cope with the situation in regrename. The following seems to cure the problem with a 4.7 m68k cross. Also bootstrapped and tested with -frename-registers enabled at -O2 on x86_64-linux. Ok everywhere? Bernd
PR rtl-optimization/52573 * regrename.c (build_def_use): Ignore REG_DEAD notes if there is a REG_UNUSED for the same register. Index: regrename.c =================================================================== --- regrename.c (revision 189425) +++ regrename.c (working copy) @@ -1718,7 +1718,8 @@ build_def_use (basic_block bb) /* Step 4: Close chains for registers that die here. */ for (note = REG_NOTES (insn); note; note = XEXP (note, 1)) - if (REG_NOTE_KIND (note) == REG_DEAD) + if (REG_NOTE_KIND (note) == REG_DEAD + && !find_regno_note (insn, REG_UNUSED, REGNO (XEXP (note, 0)))) { remove_from_hard_reg_set (&live_hard_regs, GET_MODE (XEXP (note, 0)),