summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog16
-rw-r--r--gcc/basic-block.h4
-rw-r--r--gcc/cfgbuild.c16
-rw-r--r--gcc/cfgrtl.c18
-rw-r--r--gcc/config/ia64/ia64.c2
-rw-r--r--gcc/haifa-sched.c2
-rw-r--r--gcc/sched-ebb.c2
-rw-r--r--gcc/sched-rgn.c2
-rw-r--r--gcc/ssa-ccp.c2
-rw-r--r--gcc/ssa-dce.c4
-rw-r--r--gcc/toplev.c4
11 files changed, 37 insertions, 35 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8d45988d537..f7cb2aa6fd4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,4 +1,20 @@
2002-06-10 Roger Sayle <roger@eyesopen.com>
+ Andreas Jaeger <aj@suse.de>
+
+ * cfgrtl.c (create_basic_block_structure): Remove index argument
+ and use last_basic_block++ instead. (create_basic_block): Update.
+ * cfgbuild.c (find_basic_blocks_1): Likewise.
+
+ * cfgrtl.c (compute_bb_for_insn): Remove unused "max" argument.
+ * haifa-sched.c (sched_init): Update compute_bb_for_insn caller.
+ * sched-ebb.c (schedule_ebbs): Likewise.
+ * sched-rgn.c (schedule_insns): Likewise.
+ * ssa-ccp.c (ssa_const_prop): Likewise.
+ * ssa-dcs.c (ssa_eliminate_dead_code): Likewise.
+ * toplev.c (rest_of_compilation): Likewise.
+ * config/ia64/ia64.c (ia64_reorg): Likewise.
+
+2002-06-10 Roger Sayle <roger@eyesopen.com>
* simplify-rtx.c (simplify_replace_rtx): Allow replacement
of matching registers.
diff --git a/gcc/basic-block.h b/gcc/basic-block.h
index 7de4c7c088a..e50c020dc55 100644
--- a/gcc/basic-block.h
+++ b/gcc/basic-block.h
@@ -306,7 +306,7 @@ extern struct basic_block_def entry_exit_blocks[2];
#define BLOCK_NUM(INSN) (BLOCK_FOR_INSN (INSN)->index + 0)
#define set_block_for_insn(INSN, BB) (BLOCK_FOR_INSN (INSN) = BB)
-extern void compute_bb_for_insn PARAMS ((int));
+extern void compute_bb_for_insn PARAMS ((void));
extern void free_bb_for_insn PARAMS ((void));
extern void update_bb_for_insn PARAMS ((basic_block));
@@ -333,7 +333,7 @@ extern void remove_edge PARAMS ((edge));
extern void redirect_edge_succ PARAMS ((edge, basic_block));
extern edge redirect_edge_succ_nodup PARAMS ((edge, basic_block));
extern void redirect_edge_pred PARAMS ((edge, basic_block));
-extern basic_block create_basic_block_structure PARAMS ((int, rtx, rtx, rtx, basic_block));
+extern basic_block create_basic_block_structure PARAMS ((rtx, rtx, rtx, basic_block));
extern basic_block create_basic_block PARAMS ((rtx, rtx, basic_block));
extern int flow_delete_block PARAMS ((basic_block));
extern int flow_delete_block_noexpunge PARAMS ((basic_block));
diff --git a/gcc/cfgbuild.c b/gcc/cfgbuild.c
index 0352fbe52a0..0c9c279a302 100644
--- a/gcc/cfgbuild.c
+++ b/gcc/cfgbuild.c
@@ -493,7 +493,7 @@ find_basic_blocks_1 (f)
if ((GET_CODE (insn) == CODE_LABEL || GET_CODE (insn) == BARRIER)
&& head)
{
- prev = create_basic_block_structure (last_basic_block++, head, end, bb_note, prev);
+ prev = create_basic_block_structure (head, end, bb_note, prev);
head = end = NULL_RTX;
bb_note = NULL_RTX;
}
@@ -507,7 +507,7 @@ find_basic_blocks_1 (f)
if (head && control_flow_insn_p (insn))
{
- prev = create_basic_block_structure (last_basic_block++, head, end, bb_note, prev);
+ prev = create_basic_block_structure (head, end, bb_note, prev);
head = end = NULL_RTX;
bb_note = NULL_RTX;
}
@@ -589,7 +589,7 @@ find_basic_blocks_1 (f)
}
if (head != NULL_RTX)
- create_basic_block_structure (last_basic_block++, head, end, bb_note, prev);
+ create_basic_block_structure (head, end, bb_note, prev);
else if (bb_note)
delete_insn (bb_note);
@@ -612,7 +612,6 @@ find_basic_blocks (f, nregs, file)
int nregs ATTRIBUTE_UNUSED;
FILE *file ATTRIBUTE_UNUSED;
{
- int max_uid;
basic_block bb;
timevar_push (TV_CFG);
@@ -653,14 +652,7 @@ find_basic_blocks (f, nregs, file)
tagged directly with the basic block that it starts. It is used for
more than that currently, but IMO that is the only valid use. */
- max_uid = get_max_uid ();
-#ifdef AUTO_INC_DEC
- /* Leave space for insns life_analysis makes in some cases for auto-inc.
- These cases are rare, so we don't need too much space. */
- max_uid += max_uid / 10;
-#endif
-
- compute_bb_for_insn (max_uid);
+ compute_bb_for_insn ();
/* Discover the edges of our cfg. */
make_edges (label_value_list, ENTRY_BLOCK_PTR->next_bb, EXIT_BLOCK_PTR->prev_bb, 0);
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index e40ecf23dea..70bf73b4f12 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -245,8 +245,7 @@ delete_insn_chain_and_edges (first, last)
AFTER is the basic block we should be put after. */
basic_block
-create_basic_block_structure (index, head, end, bb_note, after)
- int index;
+create_basic_block_structure (head, end, bb_note, after)
rtx head, end, bb_note;
basic_block after;
{
@@ -304,10 +303,10 @@ create_basic_block_structure (index, head, end, bb_note, after)
bb->head = head;
bb->end = end;
- bb->index = index;
+ bb->index = last_basic_block++;
bb->flags = BB_NEW;
link_block (bb, after);
- BASIC_BLOCK (index) = bb;
+ BASIC_BLOCK (bb->index) = bb;
update_bb_for_insn (bb);
/* Tag the block so that we know it has been used when considering
@@ -328,14 +327,13 @@ create_basic_block (head, end, after)
basic_block after;
{
basic_block bb;
- int index = last_basic_block++;
/* Place the new block just after the end. */
- VARRAY_GROW (basic_block_info, last_basic_block);
+ VARRAY_GROW (basic_block_info, last_basic_block+1);
n_basic_blocks++;
- bb = create_basic_block_structure (index, head, end, NULL, after);
+ bb = create_basic_block_structure (head, end, NULL, after);
bb->aux = NULL;
return bb;
}
@@ -423,12 +421,10 @@ flow_delete_block (b)
return deleted_handler;
}
-/* Records the basic block struct in BB_FOR_INSN, for every instruction
- indexed by INSN_UID. MAX is the size of the array. */
+/* Records the basic block struct in BLOCK_FOR_INSN for every insn. */
void
-compute_bb_for_insn (max)
- int max;
+compute_bb_for_insn ()
{
basic_block bb;
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index bf045cd8092..7601d761847 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -6933,7 +6933,7 @@ ia64_reorg (insns)
{
/* We are freeing block_for_insn in the toplev to keep compatibility
with old MDEP_REORGS that are not CFG based. Recompute it now. */
- compute_bb_for_insn (get_max_uid ());
+ compute_bb_for_insn ();
/* If optimizing, we'll have split before scheduling. */
if (optimize == 0)
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index 0dc84e5b7c2..c39b0505111 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -2368,7 +2368,7 @@ sched_init (dump_file)
init_dependency_caches (luid);
- compute_bb_for_insn (old_max_uid);
+ compute_bb_for_insn ();
init_alias_analysis ();
diff --git a/gcc/sched-ebb.c b/gcc/sched-ebb.c
index 91bf88ec2b9..43bf9ab4ca4 100644
--- a/gcc/sched-ebb.c
+++ b/gcc/sched-ebb.c
@@ -291,7 +291,7 @@ schedule_ebbs (dump_file)
current_sched_info = &ebb_sched_info;
allocate_reg_life_data ();
- compute_bb_for_insn (get_max_uid ());
+ compute_bb_for_insn ();
/* Schedule every region in the subroutine. */
FOR_EACH_BB (bb)
diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c
index 280f33089d6..30b2cf0d8f5 100644
--- a/gcc/sched-rgn.c
+++ b/gcc/sched-rgn.c
@@ -3016,7 +3016,7 @@ schedule_insns (dump_file)
best way to test for this kind of thing... */
allocate_reg_life_data ();
- compute_bb_for_insn (get_max_uid ());
+ compute_bb_for_insn ();
any_large_regions = 0;
large_region_blocks = sbitmap_alloc (last_basic_block);
diff --git a/gcc/ssa-ccp.c b/gcc/ssa-ccp.c
index 2549f67b4dc..af4c59356dc 100644
--- a/gcc/ssa-ccp.c
+++ b/gcc/ssa-ccp.c
@@ -992,7 +992,7 @@ ssa_const_prop ()
DF_RD_CHAIN | DF_RU_CHAIN | DF_REG_INFO | DF_HARD_REGS);
/* We need mappings from insn to its containing block. */
- compute_bb_for_insn (get_max_uid ());
+ compute_bb_for_insn ();
/* Perform a quick and dirty dead code elimination pass. This is not
as aggressive as it could be, but it's good enough to clean up a
diff --git a/gcc/ssa-dce.c b/gcc/ssa-dce.c
index 4f89941fa85..db13b9ae7e8 100644
--- a/gcc/ssa-dce.c
+++ b/gcc/ssa-dce.c
@@ -500,8 +500,6 @@ ssa_eliminate_dead_code ()
int *pdom;
struct edge_list *el;
- int max_insn_uid = get_max_uid ();
-
/* Initialize the data structures. */
mark_all_insn_unnecessary ();
VARRAY_RTX_INIT (unprocessed_instructions, 64,
@@ -511,7 +509,7 @@ ssa_eliminate_dead_code ()
/* Prepare for use of BLOCK_NUM (). */
connect_infinite_loops_to_exit ();
/* Be careful not to clear the added edges. */
- compute_bb_for_insn (max_insn_uid);
+ compute_bb_for_insn ();
/* Compute control dependence. */
pdom = (int *) xmalloc (last_basic_block * sizeof (int));
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 47011f4f4ae..12be2b1e6ee 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -2746,7 +2746,7 @@ rest_of_compilation (decl)
we'll save big on memory. */
renumber_insns (rtl_dump_file);
if (optimize)
- compute_bb_for_insn (get_max_uid ());
+ compute_bb_for_insn ();
timevar_pop (TV_JUMP);
close_dump_file (DFI_jump, print_rtl_with_bb, insns);
@@ -2794,7 +2794,7 @@ rest_of_compilation (decl)
/* The second pass of jump optimization is likely to have
removed a bunch more instructions. */
renumber_insns (rtl_dump_file);
- compute_bb_for_insn (get_max_uid ());
+ compute_bb_for_insn ();
timevar_pop (TV_CSE);
close_dump_file (DFI_cse, print_rtl_with_bb, insns);