summaryrefslogtreecommitdiff
path: root/gcc/bb-reorder.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-14 01:06:42 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-14 01:06:42 +0000
commit0c07445c8523eede218a6b8808cb2dcbafb7fdba (patch)
tree7ebe8a09f2e053c88b2a24162827fccbad43b62d /gcc/bb-reorder.c
parent35598c58e4e8f36c8ac68703435a290f11ec6b9e (diff)
downloadgcc-0c07445c8523eede218a6b8808cb2dcbafb7fdba.tar.gz
* bb-reorder.c (skip_insn_after_block): Get past the line number notes.
* flow.c (redirect_edge_and_branch_force, split_edge, try_crossjump_to_edge): Use set_block_for_new_insns. * bb-reorder.c (emit_jump_to_block_after): Call set_block_for_new_insns. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44002 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/bb-reorder.c')
-rw-r--r--gcc/bb-reorder.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index a6534d809db..e2dc44c5053 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -211,7 +211,7 @@ skip_insns_after_block (bb)
if (bb->index + 1 != n_basic_blocks)
next_head = BASIC_BLOCK (bb->index + 1)->head;
- for (last_insn = bb->end; (insn = NEXT_INSN (last_insn)); last_insn = insn)
+ for (last_insn = insn = bb->end; (insn = NEXT_INSN (insn)); )
{
if (insn == next_head)
break;
@@ -219,6 +219,7 @@ skip_insns_after_block (bb)
switch (GET_CODE (insn))
{
case BARRIER:
+ last_insn = insn;
continue;
case NOTE:
@@ -226,11 +227,19 @@ skip_insns_after_block (bb)
{
case NOTE_INSN_LOOP_END:
case NOTE_INSN_BLOCK_END:
+ last_insn = insn;
+ continue;
case NOTE_INSN_DELETED:
case NOTE_INSN_DELETED_LABEL:
continue;
default:
+ /* Make line notes attached to the succesor block unless they
+ are followed by something attached to predecesor block.
+ These notes remained after removing code in the predecesor
+ block and thus should be kept together. */
+ if (NOTE_LINE_NUMBER (insn) >= 0)
+ continue;
break;
}
break;
@@ -242,6 +251,7 @@ skip_insns_after_block (bb)
|| GET_CODE (PATTERN (NEXT_INSN (insn))) == ADDR_DIFF_VEC))
{
insn = NEXT_INSN (insn);
+ last_insn = insn;
continue;
}
break;
@@ -501,6 +511,8 @@ emit_jump_to_block_after (bb, after)
jump = emit_jump_insn_after (gen_jump (label), after);
JUMP_LABEL (jump) = label;
LABEL_NUSES (label) += 1;
+ if (basic_block_for_insn)
+ set_block_for_new_insns (jump, bb);
if (rtl_dump_file)
fprintf (rtl_dump_file, "Emitting jump to block %d (%d)\n",