On Wed, Jan 11, 2012 at 01:59:59PM +0100, Eric Botcazou wrote:
> > I'd find that very fragile. E.g. distribute_notes itself reverses the
> > order of all notes, and for no REG_NOTES I think we rely on any ordering.
>
> AFAIK distribute_notes is the only routine that redistributes the RTL notes
> for
> a fixed insn, so I'm a little skeptical about the purported fragility here.
> My point is that the complexity should be in fixup_args_size_notes instead of
> distribute_notes. Tentative patch attached.
If you prefer to do it this way, fine, but I think we should have some
ENABLE_RTL_CHECKING verification somewhere that the REG_NORETURN vs.
REG_ARGS_SIZE ordering is always correct.
> PR bootstrap/51796
> * calls.c (emit_call_1): Make sure REG_NORETURN note comes first.
> * combine.c (distribute_notes): If i3 is a noreturn call, allow
> old_size to be equal to args_size if !ACCUMULATE_OUTGOING_ARGS.
> * expr.c (fixup_args_size_notes): Put REG_ARGS_SIZE notes on
> noreturn calls even when the delta is 0.
> * rtlanal.c (find_and_remove_reg_note): New function.
> * rtl.h (find_and_remove_reg_note): Declare it.
Jakub