Commit 4897b529 by Kaz Kojima

reorg.c (relax_delay_slots): Take account of NOTE_INSN_SWITCH_TEXT_SECTIONS and…

reorg.c (relax_delay_slots): Take account of NOTE_INSN_SWITCH_TEXT_SECTIONS and targetm.can_follow_jump.

* reorg.c (relax_delay_slots): Take account of NOTE_INSN_SWITCH_TEXT_SECTIONS
  and targetm.can_follow_jump.

From-SVN: r220235
parent f7f049fa
2015-01-29 Kaz Kojima <kkojima@gcc.gnu.org>
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.
2015-01-27 Caroline Tice <cmtice@google.com> 2015-01-27 Caroline Tice <cmtice@google.com>
Committing VTV Cywin/Ming patch for Patrick Wollgast Committing VTV Cywin/Ming patch for Patrick Wollgast
......
...@@ -3213,6 +3213,19 @@ label_before_next_insn (rtx x, rtx scan_limit) ...@@ -3213,6 +3213,19 @@ label_before_next_insn (rtx x, rtx scan_limit)
return insn; return insn;
} }
/* Return TRUE if there is a NOTE_INSN_SWITCH_TEXT_SECTIONS note in between
BEG and END. */
static bool
switch_text_sections_between_p (const rtx_insn *beg, const rtx_insn *end)
{
const rtx_insn *p;
for (p = beg; p != end; p = NEXT_INSN (p))
if (NOTE_P (p) && NOTE_KIND (p) == NOTE_INSN_SWITCH_TEXT_SECTIONS)
return true;
return false;
}
/* Once we have tried two ways to fill a delay slot, make a pass over the /* Once we have tried two ways to fill a delay slot, make a pass over the
code to try to improve the results and to do such things as more jump code to try to improve the results and to do such things as more jump
...@@ -3249,7 +3262,8 @@ relax_delay_slots (rtx_insn *first) ...@@ -3249,7 +3262,8 @@ relax_delay_slots (rtx_insn *first)
target_label = find_end_label (target_label); target_label = find_end_label (target_label);
if (target_label && next_active_insn (target_label) == next if (target_label && next_active_insn (target_label) == next
&& ! condjump_in_parallel_p (insn)) && ! condjump_in_parallel_p (insn)
&& ! (next && switch_text_sections_between_p (insn, next)))
{ {
delete_jump (insn); delete_jump (insn);
continue; continue;
...@@ -3264,12 +3278,13 @@ relax_delay_slots (rtx_insn *first) ...@@ -3264,12 +3278,13 @@ relax_delay_slots (rtx_insn *first)
/* See if this jump conditionally branches around an unconditional /* See if this jump conditionally branches around an unconditional
jump. If so, invert this jump and point it to the target of the jump. If so, invert this jump and point it to the target of the
second jump. */ second jump. Check if it's possible on the target. */
if (next && simplejump_or_return_p (next) if (next && simplejump_or_return_p (next)
&& any_condjump_p (insn) && any_condjump_p (insn)
&& target_label && target_label
&& next_active_insn (target_label) == next_active_insn (next) && next_active_insn (target_label) == next_active_insn (next)
&& no_labels_between_p (insn, next)) && no_labels_between_p (insn, next)
&& targetm.can_follow_jump (insn, next))
{ {
rtx label = JUMP_LABEL (next); rtx label = JUMP_LABEL (next);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment