aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgbuild.c
diff options
context:
space:
mode:
authorZdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>2002-05-20 00:25:49 +0200
committerZdenek Dvorak <rakdver@gcc.gnu.org>2002-05-19 22:25:49 +0000
commit918ed612a1b2328a11887b7166bc07a9efde130f (patch)
treeda3145061eccb50182bb789146df5bbe4f748226 /gcc/cfgbuild.c
parente0322d5ca59e5d8657799c2c5453319a89c7a5a5 (diff)
downloadgcc-918ed612a1b2328a11887b7166bc07a9efde130f.zip
gcc-918ed612a1b2328a11887b7166bc07a9efde130f.tar.gz
gcc-918ed612a1b2328a11887b7166bc07a9efde130f.tar.bz2
basic_block.h (struct basic_block_def): Added prev_bb and next_bb fields.
* 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. From-SVN: r53642
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 5ce9d40..767b0de 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