summaryrefslogtreecommitdiff
path: root/gcc/bb-reorder.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2001-09-16 20:21:30 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2001-09-16 20:21:30 +0000
commit9dda79157a315d9dafd21f6bf414129ae6a813cf (patch)
tree3f3b141a9f45004a367eed069d691638b036e04f /gcc/bb-reorder.c
parentc00e481c16b2a2036ff5f18f412d432e50f307d6 (diff)
downloadgcc-9dda79157a315d9dafd21f6bf414129ae6a813cf.tar.gz
* basic-block.h (free_bb_for_insn): Declare.
* bb-reorder.c (label_for_bb): Use block_label. (emit_jump_to_block_after): Remove. (insert_intra_1): Do not update block_for_insn. (insert_inter_bb_scope_notes): Likewise; update bb->end * cfg.c (free_bb_for_insn): New. (try_rediret_by_replacing_jump): Avoid set_block_for_new_insns call. (force_nonfallthru_and_redirect): Likewise; do not update BB boundaries. (commit_one_edge_insertion): Likewise. (commit_one_edge_insertion): Do not update BB boundary. (commit_edge_insertions): Do not call compute_bb_for_insn. * cfgbuild.c (find_basic_blocks): Do not free basic_block_for_insn. * cfgcleanup.c (merge_blocks_move_predecessor): Use reorder_insns_nobb. (merge_blocks_move_successor_nojumps): Likewise. (try_crossjump_to_edge): Do not update block_for_insn. * combine.c (combine_instructions): Remove compute_bb_for_insn call. * df.c (df_pattern_emit_later): Do not update BB boundary. (df_jump_pattern_emit_after): Likewise. (df_insn_move_before): Use emit_insn_before. * emit-rtl.c (try_split): Emit after trial to get bb boundary updated properly. (add_insn_after, add_insn_before, emit_insns_after): Update BB boundaries and basic_block_for_insn. (reorder_insns_nobb): Rename from reorder_insns. (reorder_insns): New. (emit_block_insn_before, emit_block_insn_after): Kill. * flow.c (check_function_return_warnings): Do not call compute_bb_for_insn; Do not free basic_block_for_insn. (attempt_auto_inc): Do not update basic_block_for_insn. * function.c (emit_return_into_block): Likewise; do not update BB boundaries. * gcse.c (handle_avail_expr): Do not update basic_block_for_insn. (insert_insn_end_bb): Use emit_insn_before; Likewise. (pre_insert_copy_insn): Likewise. (update_ld_motion_notes): Likewise. (insert_insn_start_bb): Likewise. (replace_store_insn): Likewise. * ifcvt.c (noce_process_if_block): Likewise. (if_convert): Do not call compute_bb_for_insn. * lcm.c (optimize_mode_switching): Do not update BB boundaries. Use emit_insn_before and emit_insn_after. * recog.c (split_all_insns): Do not update BB boundaries; Do not call compute_bb_for_insn. (peephole2_optimize): Do not update BB boundaries. * reg-stack.c (emit_pop_insn): Use emit_insn_after and emit_insn_before. (emit_swap_insn): Likewise. (convert_regs_1): Likewise. * reload1.c (reload): Call compute_bb_for_insn. * rtl.h (reorder_insns_nobb): Declare. * ssa.c (rename_equivalent_regs): Use emit_insn_before. * toplev.c (rest_of_compilation): Call free_bb_for_insn at places CFG is invalidated; do not call compute_bb_for_insn. * cfg.c (expunge_block): Invalidate BB structure. * (merge_blocks_nomove): Update properly BLOCK_FOR_INSN array. * cfg.c (verify_flow_info): Verify the basic_block_for_insn array. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45647 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/bb-reorder.c')
-rw-r--r--gcc/bb-reorder.c62
1 files changed, 6 insertions, 56 deletions
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index f51294b6d44..c471a6fa6e8 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -180,7 +180,6 @@ static void record_effective_endpoints PARAMS ((void));
static void make_reorder_chain PARAMS ((void));
static basic_block make_reorder_chain_1 PARAMS ((basic_block, basic_block));
static rtx label_for_bb PARAMS ((basic_block));
-static rtx emit_jump_to_block_after PARAMS ((basic_block, rtx));
static void fixup_reorder_chain PARAMS ((void));
static void relate_bbs_with_scopes PARAMS ((scope));
static scope make_new_scope PARAMS ((int, rtx));
@@ -505,60 +504,15 @@ label_for_bb (bb)
fprintf (rtl_dump_file, "Emitting label for block %d\n",
bb->index);
- label = emit_label_before (gen_label_rtx (), label);
- if (bb->head == RBI (bb)->eff_head)
+ label = block_label (bb);
+ if (bb->head == PREV_INSN (RBI (bb)->eff_head))
RBI (bb)->eff_head = label;
- bb->head = label;
- if (basic_block_for_insn)
- set_block_for_insn (label, bb);
}
return label;
}
-/* Emit a jump to BB after insn AFTER. */
-
-static rtx
-emit_jump_to_block_after (bb, after)
- basic_block bb;
- rtx after;
-{
- rtx jump;
-
- if (bb != EXIT_BLOCK_PTR)
- {
- rtx label = label_for_bb (bb);
- 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\n",
- bb->index);
- }
- else
- {
-#ifdef HAVE_return
- if (! HAVE_return)
- abort ();
- jump = emit_jump_insn_after (gen_return (), after);
- if (basic_block_for_insn)
- set_block_for_new_insns (jump, bb);
-
- if (rtl_dump_file)
- fprintf (rtl_dump_file, "Emitting return\n");
-#else
- abort ();
-#endif
- }
-
- return jump;
-}
-
-
/* Given a reorder chain, rearrange the code to match. */
static void
@@ -1122,8 +1076,6 @@ insert_intra_1 (s, ip, bb)
{
*ip = emit_note_after (NOTE_INSN_BLOCK_BEG, *ip);
NOTE_BLOCK (*ip) = NOTE_BLOCK (s->note_beg);
- if (basic_block_for_insn)
- set_block_for_insn (*ip, bb);
}
for (p = s->inner; p; p = p->next)
@@ -1133,8 +1085,6 @@ insert_intra_1 (s, ip, bb)
{
*ip = emit_note_after (NOTE_INSN_BLOCK_END, *ip);
NOTE_BLOCK (*ip) = NOTE_BLOCK (s->note_end);
- if (basic_block_for_insn)
- set_block_for_insn (*ip, bb);
}
}
@@ -1220,6 +1170,8 @@ insert_inter_bb_scope_notes (bb1, bb2)
/* Close scopes. */
if (bb1)
{
+ rtx end = bb1->end;
+
scope s = RBI (bb1)->scope;
ip = RBI (bb1)->eff_end;
while (s != com)
@@ -1228,11 +1180,11 @@ insert_inter_bb_scope_notes (bb1, bb2)
{
ip = emit_note_after (NOTE_INSN_BLOCK_END, ip);
NOTE_BLOCK (ip) = NOTE_BLOCK (s->note_end);
- if (basic_block_for_insn)
- set_block_for_insn (ip, bb1);
}
s = s->outer;
}
+ /* Emitting note may move the end of basic block to unwanted place. */
+ bb1->end = end;
}
/* Open scopes. */
@@ -1246,8 +1198,6 @@ insert_inter_bb_scope_notes (bb1, bb2)
{
ip = emit_note_before (NOTE_INSN_BLOCK_BEG, ip);
NOTE_BLOCK (ip) = NOTE_BLOCK (s->note_beg);
- if (basic_block_for_insn)
- set_block_for_insn (ip, bb2);
}
s = s->outer;
}