aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfglayout.c
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2012-05-08 15:54:13 +0000
committerMichael Matz <matz@gcc.gnu.org>2012-05-08 15:54:13 +0000
commitbcc708fcdc60c6b4485b1796ac1ba61c5f56b0b3 (patch)
tree6c299e917ec2a3f887c9fedcefdf3a151c51eebb /gcc/cfglayout.c
parent88231ff68197c2c22f33e1a8ba251bc0b02b1f2d (diff)
downloadgcc-bcc708fcdc60c6b4485b1796ac1ba61c5f56b0b3.zip
gcc-bcc708fcdc60c6b4485b1796ac1ba61c5f56b0b3.tar.gz
gcc-bcc708fcdc60c6b4485b1796ac1ba61c5f56b0b3.tar.bz2
basic-block.h (struct rtl_bb_info): Remove visited member and move head_ member to ...
* basic-block.h (struct rtl_bb_info): Remove visited member and move head_ member to ... (struct basic_block_def.basic_block_il_dependent): ... the new member x, replacing but containing old member rtl. (enum bb_flags): New BB_VISITED flag. (BB_HEADER, BB_FOOTER): New macros. * jump.c (mark_all_labels): Adjust. * cfgcleanup.c (try_optimize_cfg): Adjust. * cfglayout.c (record_effective_endpoints): Adjust. (relink_block_chain): Ditto (and don't fiddle with visited). (fixup_reorder_chain): Adjust. (fixup_fallthru_exit_predecessor): Ditto. (cfg_layout_duplicate_bb): Ditto. * combine.c (update_cfg_for_uncondjump): Adjust. * bb-reorder.c (struct bbro_basic_block_data_def): Add visited member. (bb_visited_trace): New accessor. (mark_bb_visited): Move in front. (rotate_loop): Use bb_visited_trace. (find_traces_1_round): Ditto. (emit_barrier_after): Ditto. (copy_bb): Ditto, and initialize visited on resize. (reorder_basic_blocks): Initize visited member. (duplicate_computed_gotos): Clear bb flags at start, use BB_VISITED flags. * cfgrtl.c (try_redirect_by_replacing_jump): Adjust. (rtl_verify_flow_info_1): Ditto. (cfg_layout_split_block): Ditto. (cfg_layout_delete_block): Ditto. (cfg_layout_merge_blocks): Ditto. (init_rtl_bb_info): Adjust and initialize il.x.head_ member. From-SVN: r187288
Diffstat (limited to 'gcc/cfglayout.c')
-rw-r--r--gcc/cfglayout.c53
1 files changed, 25 insertions, 28 deletions
diff --git a/gcc/cfglayout.c b/gcc/cfglayout.c
index c6e1f83..2a5448c 100644
--- a/gcc/cfglayout.c
+++ b/gcc/cfglayout.c
@@ -208,11 +208,11 @@ record_effective_endpoints (void)
rtx end;
if (PREV_INSN (BB_HEAD (bb)) && next_insn != BB_HEAD (bb))
- bb->il.rtl->header = unlink_insn_chain (next_insn,
+ BB_HEADER (bb) = unlink_insn_chain (next_insn,
PREV_INSN (BB_HEAD (bb)));
end = skip_insns_after_block (bb);
if (NEXT_INSN (BB_END (bb)) && BB_END (bb) != end)
- bb->il.rtl->footer = unlink_insn_chain (NEXT_INSN (BB_END (bb)), end);
+ BB_FOOTER (bb) = unlink_insn_chain (NEXT_INSN (BB_END (bb)), end);
next_insn = NEXT_INSN (BB_END (bb));
}
@@ -633,9 +633,8 @@ reemit_insn_block_notes (void)
/* Link the basic blocks in the correct order, compacting the basic
- block queue while at it. This also clears the visited flag on
- all basic blocks. If STAY_IN_CFGLAYOUT_MODE is false, this function
- also clears the basic block header and footer fields.
+ block queue while at it. If STAY_IN_CFGLAYOUT_MODE is false, this
+ function also clears the basic block header and footer fields.
This function is usually called after a pass (e.g. tracer) finishes
some transformations while in cfglayout mode. The required sequence
@@ -681,13 +680,12 @@ relink_block_chain (bool stay_in_cfglayout_mode)
prev_bb->next_bb = EXIT_BLOCK_PTR;
EXIT_BLOCK_PTR->prev_bb = prev_bb;
- /* Then, clean up the aux and visited fields. */
+ /* Then, clean up the aux fields. */
FOR_ALL_BB (bb)
{
bb->aux = NULL;
- bb->il.rtl->visited = 0;
if (!stay_in_cfglayout_mode)
- bb->il.rtl->header = bb->il.rtl->footer = NULL;
+ BB_HEADER (bb) = BB_FOOTER (bb) = NULL;
}
/* Maybe reset the original copy tables, they are not valid anymore
@@ -723,14 +721,14 @@ fixup_reorder_chain (void)
for (bb = ENTRY_BLOCK_PTR->next_bb; bb; bb = (basic_block) bb->aux)
{
- if (bb->il.rtl->header)
+ if (BB_HEADER (bb))
{
if (insn)
- NEXT_INSN (insn) = bb->il.rtl->header;
+ NEXT_INSN (insn) = BB_HEADER (bb);
else
- set_first_insn (bb->il.rtl->header);
- PREV_INSN (bb->il.rtl->header) = insn;
- insn = bb->il.rtl->header;
+ set_first_insn (BB_HEADER (bb));
+ PREV_INSN (BB_HEADER (bb)) = insn;
+ insn = BB_HEADER (bb);
while (NEXT_INSN (insn))
insn = NEXT_INSN (insn);
}
@@ -740,10 +738,10 @@ fixup_reorder_chain (void)
set_first_insn (BB_HEAD (bb));
PREV_INSN (BB_HEAD (bb)) = insn;
insn = BB_END (bb);
- if (bb->il.rtl->footer)
+ if (BB_FOOTER (bb))
{
- NEXT_INSN (insn) = bb->il.rtl->footer;
- PREV_INSN (bb->il.rtl->footer) = insn;
+ NEXT_INSN (insn) = BB_FOOTER (bb);
+ PREV_INSN (BB_FOOTER (bb)) = insn;
while (NEXT_INSN (insn))
insn = NEXT_INSN (insn);
}
@@ -799,7 +797,7 @@ fixup_reorder_chain (void)
{
gcc_assert (!onlyjump_p (bb_end_insn)
|| returnjump_p (bb_end_insn));
- bb->il.rtl->footer = emit_barrier_after (bb_end_insn);
+ BB_FOOTER (bb) = emit_barrier_after (bb_end_insn);
continue;
}
@@ -908,7 +906,6 @@ fixup_reorder_chain (void)
nb = force_nonfallthru_and_redirect (e_fall, e_fall->dest, ret_label);
if (nb)
{
- nb->il.rtl->visited = 1;
nb->aux = bb->aux;
bb->aux = nb;
/* Don't process this new block. */
@@ -1062,8 +1059,8 @@ fixup_fallthru_exit_predecessor (void)
bb = split_block (bb, NULL)->dest;
bb->aux = c->aux;
c->aux = bb;
- bb->il.rtl->footer = c->il.rtl->footer;
- c->il.rtl->footer = NULL;
+ BB_FOOTER (bb) = BB_FOOTER (c);
+ BB_FOOTER (c) = NULL;
}
while (c->aux != bb)
@@ -1272,24 +1269,24 @@ cfg_layout_duplicate_bb (basic_block bb)
EXIT_BLOCK_PTR->prev_bb);
BB_COPY_PARTITION (new_bb, bb);
- if (bb->il.rtl->header)
+ if (BB_HEADER (bb))
{
- insn = bb->il.rtl->header;
+ insn = BB_HEADER (bb);
while (NEXT_INSN (insn))
insn = NEXT_INSN (insn);
- insn = duplicate_insn_chain (bb->il.rtl->header, insn);
+ insn = duplicate_insn_chain (BB_HEADER (bb), insn);
if (insn)
- new_bb->il.rtl->header = unlink_insn_chain (insn, get_last_insn ());
+ BB_HEADER (new_bb) = unlink_insn_chain (insn, get_last_insn ());
}
- if (bb->il.rtl->footer)
+ if (BB_FOOTER (bb))
{
- insn = bb->il.rtl->footer;
+ insn = BB_FOOTER (bb);
while (NEXT_INSN (insn))
insn = NEXT_INSN (insn);
- insn = duplicate_insn_chain (bb->il.rtl->footer, insn);
+ insn = duplicate_insn_chain (BB_FOOTER (bb), insn);
if (insn)
- new_bb->il.rtl->footer = unlink_insn_chain (insn, get_last_insn ());
+ BB_FOOTER (new_bb) = unlink_insn_chain (insn, get_last_insn ());
}
return new_bb;