summaryrefslogtreecommitdiff
path: root/gcc/cfgbuild.c
diff options
context:
space:
mode:
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-19 22:25:49 +0000
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-19 22:25:49 +0000
commit7fa55aef8e8e951f40edb73837f7a2ca2cd126d0 (patch)
treeda3145061eccb50182bb789146df5bbe4f748226 /gcc/cfgbuild.c
parent08eedad60368d251f0544a6376b0f999d0f8a54a (diff)
downloadgcc-7fa55aef8e8e951f40edb73837f7a2ca2cd126d0.tar.gz
* basic_block.h (struct basic_block_def): Added prev_bb and next_bb
fields. (FOR_BB_BETWEEN, FOR_ALL_BB, FOR_ALL_BB_REVERSE): New macros for traversing basic block chain. (create_basic_block_structure, create_basic_block): Declaration changed. (link_block, unlink_block): Declare. * cfg.c (entry_exit_blocks): Initialize new fields. (link_block, unlink_block): New. (expunge_block_nocompact): Unlink basic block. (dump_flow_info): Print prev_bb/next_bb fields. * cfgbuild.c (find_basic_blocks_1, find_basic_blocks): Modified. * cfgcleanup.c (merge_blocks_move_predecessor_nojumps): Modified. * cfglayout.c (fixup_reorder_chain, cfg_layout_duplicate_bb): Modified. * cfgrtl.c (create_basic_block_structure, create_basic_block, split_block, force_nonfallthru_and_redirect, split_edge): Modified. (verify_flow_info): Check that list agrees with numbering. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53642 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgbuild.c')
-rw-r--r--gcc/cfgbuild.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/cfgbuild.c b/gcc/cfgbuild.c
index 5ce9d40f3b0..767b0dee0bc 100644
--- a/gcc/cfgbuild.c
+++ b/gcc/cfgbuild.c
@@ -476,6 +476,7 @@ find_basic_blocks_1 (f)
rtx trll = NULL_RTX;
rtx head = NULL_RTX;
rtx end = NULL_RTX;
+ basic_block prev = ENTRY_BLOCK_PTR;
/* We process the instructions in a slightly different way than we did
previously. This is so that we see a NOTE_BASIC_BLOCK after we have
@@ -492,7 +493,7 @@ find_basic_blocks_1 (f)
if ((GET_CODE (insn) == CODE_LABEL || GET_CODE (insn) == BARRIER)
&& head)
{
- create_basic_block_structure (i++, head, end, bb_note);
+ prev = create_basic_block_structure (i++, head, end, bb_note, prev);
head = end = NULL_RTX;
bb_note = NULL_RTX;
}
@@ -506,7 +507,7 @@ find_basic_blocks_1 (f)
if (head && control_flow_insn_p (insn))
{
- create_basic_block_structure (i++, head, end, bb_note);
+ prev = create_basic_block_structure (i++, head, end, bb_note, prev);
head = end = NULL_RTX;
bb_note = NULL_RTX;
}
@@ -588,7 +589,7 @@ find_basic_blocks_1 (f)
}
if (head != NULL_RTX)
- create_basic_block_structure (i++, head, end, bb_note);
+ create_basic_block_structure (i++, head, end, bb_note, prev);
else if (bb_note)
delete_insn (bb_note);
@@ -633,6 +634,8 @@ find_basic_blocks (f, nregs, file)
}
n_basic_blocks = count_basic_blocks (f);
+ ENTRY_BLOCK_PTR->next_bb = EXIT_BLOCK_PTR;
+ EXIT_BLOCK_PTR->prev_bb = ENTRY_BLOCK_PTR;
/* Size the basic block table. The actual structures will be allocated
by find_basic_blocks_1, since we want to keep the structure pointers