Hi! Sorry for dropping this once again.
On Thu, Jan 30, 2020 at 05:14:08PM +0100, Jakub Jelinek wrote: > Here is what I meant as the alternative, i.e. don't check any predicates, > just gen_add3_insn, if that fails, force rs into register and retry. I don't like gen_add3_insn here *at all*, as I said, but okay, you're only fixing existing code. But as long as it is there, this code will be a problem child. > And, add REG_FRAME_RELATED_EXPR note always when we haven't emitted a single > insn that has rtl exactly matching what we'd add the REG_FRAME_RELATED_EXPR > with (in that case, dwarf2cfi.c is able to figure it out by itself, no need > to waste compile time memory). I would say "just always emit that note", but that is what the patch does, already :-) > + rtx set; > + if (!NONJUMP_INSN_P (insn) > + || NEXT_INSN (insn) > + || (set = single_set (insn)) == NULL_RTX > + || SET_DEST (set) != end_addr > + || GET_CODE (SET_SRC (set)) != PLUS > + || XEXP (SET_SRC (set), 0) != stack_pointer_rtx > + || XEXP (SET_SRC (set), 1) != rs) Please don't have side effects in conditions. Two nested ifs would be fine here. > + insn = emit_insn (insn); > + /* Describe the effect of INSN to the CFI engine, unless it > + is a single insn that describes it itself. */ > add_reg_note (insn, REG_FRAME_RELATED_EXPR, > gen_rtx_SET (end_addr, > gen_rtx_PLUS (Pmode, stack_pointer_rtx, > rs))); So please fix the comment? Segher