This patch is to fix 2 issues found in dbr_schedule when trying to
fix PR target/64761. The first is relax_delay_slots removes
the jump insn in the insns like below:
(jump_insn/j 74 58 59 (set (pc) (label_ref:SI 29)) ...)
(barrier 59 74 105)
(note 105 59 29 NOTE_INSN_SWITCH_TEXT_SECTIONS)
(code_label 29 105 30 31 "" [5 uses])
(insn 31 30 32 (set (reg ...
i.e. relax_delay_slot tries to delete the jump insn pointing to
the next active insn of that jump insn as a trivial jump even when
there is a NOTE_INSN_SWITCH_TEXT_SECTIONS note between that jump
and its next active insn.
The second issue is that relax_delay_slots does a variant of
follow jump optimization without checking targetm.can_follow_jump.
--
PR target/64761
* reorg.c (switch_text_sections_between_p): New function.
(relax_delay_slots): Call it when testing if the jump insn
is removable. Use targetm.can_follow_jump when testing if
the conditional branch can follow an unconditional jump.