On Sat, Jan 14, 2017 at 09:47:41PM -0700, Jeff Law wrote: > > PR target/72749 > > * cfgrtl.c (rtl_split_edge): Also patch jump insns that jump to the > > fallthrough. > > * haifa-sched.c (dump_insn_stream): Don't crash if there is a label > > in the currently scheduled RTL fragment. > So presumably the semantics in this case can only mean one thing -- both > the fallthru and the jump have to go to the same place after splitting. > Right? ISTM that ought to be documented in rtl_split_edge somewhere.
We could call patch_jump_insn in *all* cases, except for simple jumps it does gcc_assert (JUMP_LABEL (insn) == old_label); which is a useful check (for the other callers), and patch_jump_insn isn't a very cheap routine to call anyway, better not do it too often. > In this case is the edge a fallthru or branch edge? Both! You get only one edge if both jump targets are the same. > And, no we don't make any guarantee about degenerate jumps -- a jump > with a side effect in particular can easily survive. I wouldn't be > surprised if there's various bugs lurking for cases where we have a > degenerate jump like that. It's just not common enough to have been > heavily exercised. > > Patch with PATTERN fix is OK. Thanks, I'll commit it tomorrow. Segher