cfgrtl.c (try_redirect_by_replacing_jump): Move jump immediatelly before BARRIER.

PR/11640
	* cfgrtl.c (try_redirect_by_replacing_jump): Move jump
	immediatelly before BARRIER.

From-SVN: r73142
This commit is contained in:
Josef Zlomek 2003-10-31 15:09:34 +01:00 committed by Josef Zlomek
parent c2edc52b76
commit 5d693491f0
2 changed files with 30 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2003-10-31 Josef Zlomek <zlomekj@suse.cz>
PR/11640
* cfgrtl.c (try_redirect_by_replacing_jump): Move jump
immediatelly before BARRIER.
2003-10-31 Kelley Cook <kcook@gcc.gnu.org>
* Makefile.in (STRICT2_WARN): Add -Wold-style-definition.

View File

@ -793,6 +793,30 @@ try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout)
barrier = next_nonnote_insn (src->end);
if (!barrier || GET_CODE (barrier) != BARRIER)
emit_barrier_after (src->end);
else
{
if (barrier != NEXT_INSN (src->end))
{
/* Move the jump before barrier so that the notes
which originally were or were created before jump table are
inside the basic block. */
rtx new_insn = src->end;
rtx tmp;
for (tmp = NEXT_INSN (src->end); tmp != barrier;
tmp = NEXT_INSN (tmp))
set_block_for_insn (tmp, src);
NEXT_INSN (PREV_INSN (new_insn)) = NEXT_INSN (new_insn);
PREV_INSN (NEXT_INSN (new_insn)) = PREV_INSN (new_insn);
NEXT_INSN (new_insn) = barrier;
NEXT_INSN (PREV_INSN (barrier)) = new_insn;
PREV_INSN (new_insn) = PREV_INSN (barrier);
PREV_INSN (barrier) = new_insn;
}
}
}
/* Keep only one edge out and set proper flags. */