> That's also overcomplicated.

Yes, I agree that's too heavy.

> rtx *ptail = &REG_NOTES (to_insn);
> while (*ptail != NULL_RTX)
>    ptail = &XEXP (*ptail, 1);
> 
> gives you a pointer to the end which you can then use to append,
> unconditionally. As mentioned above, I think it would be simpler to keep
> this logic in the caller functions and avoid introducing
> append_insn_reg_notes.

I disagree: there are currently n ways of copying NOTEs in the RTL middle-end, 
with different properties each time.  We need only one primitive in rtlanal.c.

-- 
Eric Botcazou

Reply via email to