cfgrtl.c (commit_one_edge_insertion): Remove always-true test and reindent the subsequent block.
* cfgrtl.c (commit_one_edge_insertion): Remove always-true test and reindent the subsequent block. From-SVN: r173685
This commit is contained in:
parent
cddebdb7a8
commit
898c90c0fd
@ -1,3 +1,8 @@
|
|||||||
|
2011-05-11 Eric Botcazou <ebotcazou@adacore.com>
|
||||||
|
|
||||||
|
* cfgrtl.c (commit_one_edge_insertion): Remove always-true test and
|
||||||
|
reindent the subsequent block.
|
||||||
|
|
||||||
2011-05-11 Satoru Takabayashi <satorux@google.com>
|
2011-05-11 Satoru Takabayashi <satorux@google.com>
|
||||||
Paul Pluzhnikov <ppluzhnikov@google.com>
|
Paul Pluzhnikov <ppluzhnikov@google.com>
|
||||||
|
|
||||||
|
110
gcc/cfgrtl.c
110
gcc/cfgrtl.c
@ -1465,80 +1465,76 @@ void
|
|||||||
commit_one_edge_insertion (edge e)
|
commit_one_edge_insertion (edge e)
|
||||||
{
|
{
|
||||||
rtx before = NULL_RTX, after = NULL_RTX, insns, tmp, last;
|
rtx before = NULL_RTX, after = NULL_RTX, insns, tmp, last;
|
||||||
basic_block bb = NULL;
|
basic_block bb;
|
||||||
|
|
||||||
/* Pull the insns off the edge now since the edge might go away. */
|
/* Pull the insns off the edge now since the edge might go away. */
|
||||||
insns = e->insns.r;
|
insns = e->insns.r;
|
||||||
e->insns.r = NULL_RTX;
|
e->insns.r = NULL_RTX;
|
||||||
|
|
||||||
if (!before && !after)
|
/* Figure out where to put these insns. If the destination has
|
||||||
|
one predecessor, insert there. Except for the exit block. */
|
||||||
|
if (single_pred_p (e->dest) && e->dest != EXIT_BLOCK_PTR)
|
||||||
{
|
{
|
||||||
/* Figure out where to put these things. If the destination has
|
bb = e->dest;
|
||||||
one predecessor, insert there. Except for the exit block. */
|
|
||||||
if (single_pred_p (e->dest) && e->dest != EXIT_BLOCK_PTR)
|
|
||||||
{
|
|
||||||
bb = e->dest;
|
|
||||||
|
|
||||||
/* Get the location correct wrt a code label, and "nice" wrt
|
/* Get the location correct wrt a code label, and "nice" wrt
|
||||||
a basic block note, and before everything else. */
|
a basic block note, and before everything else. */
|
||||||
tmp = BB_HEAD (bb);
|
tmp = BB_HEAD (bb);
|
||||||
if (LABEL_P (tmp))
|
if (LABEL_P (tmp))
|
||||||
tmp = NEXT_INSN (tmp);
|
tmp = NEXT_INSN (tmp);
|
||||||
if (NOTE_INSN_BASIC_BLOCK_P (tmp))
|
if (NOTE_INSN_BASIC_BLOCK_P (tmp))
|
||||||
tmp = NEXT_INSN (tmp);
|
tmp = NEXT_INSN (tmp);
|
||||||
if (tmp == BB_HEAD (bb))
|
if (tmp == BB_HEAD (bb))
|
||||||
before = tmp;
|
before = tmp;
|
||||||
else if (tmp)
|
else if (tmp)
|
||||||
after = PREV_INSN (tmp);
|
after = PREV_INSN (tmp);
|
||||||
else
|
else
|
||||||
after = get_last_insn ();
|
after = get_last_insn ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If the source has one successor and the edge is not abnormal,
|
/* If the source has one successor and the edge is not abnormal,
|
||||||
insert there. Except for the entry block. */
|
insert there. Except for the entry block. */
|
||||||
else if ((e->flags & EDGE_ABNORMAL) == 0
|
else if ((e->flags & EDGE_ABNORMAL) == 0
|
||||||
&& single_succ_p (e->src)
|
&& single_succ_p (e->src)
|
||||||
&& e->src != ENTRY_BLOCK_PTR)
|
&& e->src != ENTRY_BLOCK_PTR)
|
||||||
{
|
{
|
||||||
bb = e->src;
|
bb = e->src;
|
||||||
|
|
||||||
/* It is possible to have a non-simple jump here. Consider a target
|
/* It is possible to have a non-simple jump here. Consider a target
|
||||||
where some forms of unconditional jumps clobber a register. This
|
where some forms of unconditional jumps clobber a register. This
|
||||||
happens on the fr30 for example.
|
happens on the fr30 for example.
|
||||||
|
|
||||||
We know this block has a single successor, so we can just emit
|
We know this block has a single successor, so we can just emit
|
||||||
the queued insns before the jump. */
|
the queued insns before the jump. */
|
||||||
if (JUMP_P (BB_END (bb)))
|
if (JUMP_P (BB_END (bb)))
|
||||||
before = BB_END (bb);
|
before = BB_END (bb);
|
||||||
else
|
|
||||||
{
|
|
||||||
/* We'd better be fallthru, or we've lost track of
|
|
||||||
what's what. */
|
|
||||||
gcc_assert (e->flags & EDGE_FALLTHRU);
|
|
||||||
|
|
||||||
after = BB_END (bb);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* Otherwise we must split the edge. */
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bb = split_edge (e);
|
/* We'd better be fallthru, or we've lost track of what's what. */
|
||||||
after = BB_END (bb);
|
gcc_assert (e->flags & EDGE_FALLTHRU);
|
||||||
|
|
||||||
if (flag_reorder_blocks_and_partition
|
after = BB_END (bb);
|
||||||
&& targetm.have_named_sections
|
|
||||||
&& e->src != ENTRY_BLOCK_PTR
|
|
||||||
&& BB_PARTITION (e->src) == BB_COLD_PARTITION
|
|
||||||
&& !(e->flags & EDGE_CROSSING)
|
|
||||||
&& JUMP_P (after)
|
|
||||||
&& !any_condjump_p (after)
|
|
||||||
&& (single_succ_edge (bb)->flags & EDGE_CROSSING))
|
|
||||||
add_reg_note (after, REG_CROSSING_JUMP, NULL_RTX);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now that we've found the spot, do the insertion. */
|
/* Otherwise we must split the edge. */
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bb = split_edge (e);
|
||||||
|
after = BB_END (bb);
|
||||||
|
|
||||||
|
if (flag_reorder_blocks_and_partition
|
||||||
|
&& targetm.have_named_sections
|
||||||
|
&& e->src != ENTRY_BLOCK_PTR
|
||||||
|
&& BB_PARTITION (e->src) == BB_COLD_PARTITION
|
||||||
|
&& !(e->flags & EDGE_CROSSING)
|
||||||
|
&& JUMP_P (after)
|
||||||
|
&& !any_condjump_p (after)
|
||||||
|
&& (single_succ_edge (bb)->flags & EDGE_CROSSING))
|
||||||
|
add_reg_note (after, REG_CROSSING_JUMP, NULL_RTX);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Now that we've found the spot, do the insertion. */
|
||||||
if (before)
|
if (before)
|
||||||
{
|
{
|
||||||
emit_insn_before_noloc (insns, before, bb);
|
emit_insn_before_noloc (insns, before, bb);
|
||||||
|
Loading…
Reference in New Issue
Block a user