On Sun, Nov 24, 2019 at 08:55:37PM +0100, Bernd Schmidt wrote: > On 11/24/19 8:43 PM, Segher Boessenkool wrote: > > But. Allowing autoinc into jump insns means those jump insns may then > > eventually need an output reload; it may just have been because of that? > > That's almost certainly the reasoning, but as I pointed out in my > original mail - reload is careful around autoincs and emits the reload > sequence before the reloaded insn.
Yes, and that isn't anything new either. Does LRA do this as well? ... Yes it does, see lra-constraints.c, search for "Because this might be a jump" as well. > For example, see inc_for_reload: > /* Postincrement. > Because this might be a jump insn or a compare, and because RELOADREG > may not be available after the insn in an input reload, we must do > the incrementation before the insn being reloaded for. > > On m68k with cc0 this is already necessary, because even a cmp insn > cannot have output reloads (they would overwrite the flags). This is why > I think it should be safe to allow them in jumps too. Yeah, auto-modify makes my head hurt :-) Output reloads definitely are *not* safe in jumps, but auto-modify seems to be indeed. Segher