From c319629b9a95ef4d8382cb86647589ee06f837d1 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Sun, 15 Jul 2001 08:47:05 -0700 Subject: [PATCH] flow.c (redirect_edge_and_branch_force): Initialize global_live_at_start and global_live_at_end. * flow.c (redirect_edge_and_branch_force): Initialize global_live_at_start and global_live_at_end. (allocate_bb_life_data): Export. * basic-block.h (allocate_bb_life_data): Declare it. * toplev.c (rest_of_compilation): Call it. From-SVN: r44023 --- gcc/ChangeLog | 8 ++++++++ gcc/basic-block.h | 1 + gcc/flow.c | 12 ++++++++++-- gcc/toplev.c | 1 + 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c9f6acd2579..90761024ad0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2001-07-15 Richard Henderson + + * flow.c (redirect_edge_and_branch_force): Initialize + global_live_at_start and global_live_at_end. + (allocate_bb_life_data): Export. + * basic-block.h (allocate_bb_life_data): Declare. + * toplev.c (rest_of_compilation): Call it. + 2001-07-15 Richard Henderson * config/alpha/alpha.c (alpha_tablejump_addr_vec): New. diff --git a/gcc/basic-block.h b/gcc/basic-block.h index fc590738705..656c13b9801 100644 --- a/gcc/basic-block.h +++ b/gcc/basic-block.h @@ -593,6 +593,7 @@ extern void debug_bb_n PARAMS ((int)); extern void dump_regset PARAMS ((regset, FILE *)); extern void debug_regset PARAMS ((regset)); extern void allocate_reg_life_data PARAMS ((void)); +extern void allocate_bb_life_data PARAMS ((void)); extern void find_unreachable_blocks PARAMS ((void)); /* This function is always defined so it can be called from the diff --git a/gcc/flow.c b/gcc/flow.c index ecaf9ea9cd5..56b40f0e625 100644 --- a/gcc/flow.c +++ b/gcc/flow.c @@ -483,7 +483,6 @@ static void flow_loop_tree_node_add PARAMS ((struct loop *, struct loop *)); static void flow_loops_tree_build PARAMS ((struct loops *)); static int flow_loop_level_compute PARAMS ((struct loop *, int)); static int flow_loops_level_compute PARAMS ((struct loops *)); -static void allocate_bb_life_data PARAMS ((void)); static void find_sub_basic_blocks PARAMS ((basic_block)); static bool redirect_edge_and_branch PARAMS ((edge, basic_block)); static basic_block redirect_edge_and_branch_force PARAMS ((edge, basic_block)); @@ -1933,6 +1932,15 @@ redirect_edge_and_branch_force (e, target) new_edge->probability = e->probability; new_edge->count = e->count; + if (e->dest->global_live_at_start) + { + new_bb->global_live_at_start = OBSTACK_ALLOC_REG_SET (&flow_obstack); + new_bb->global_live_at_end = OBSTACK_ALLOC_REG_SET (&flow_obstack); + COPY_REG_SET (new_bb->global_live_at_start, + e->dest->global_live_at_start); + COPY_REG_SET (new_bb->global_live_at_end, new_bb->global_live_at_start); + } + /* Wire edge in. */ new_edge->src = e->src; new_edge->dest = new_bb; @@ -4675,7 +4683,7 @@ calculate_global_regs_live (blocks_in, blocks_out, flags) /* Allocate the permanent data structures that represent the results of life analysis. Not static since used also for stupid life analysis. */ -static void +void allocate_bb_life_data () { register int i; diff --git a/gcc/toplev.c b/gcc/toplev.c index 416187275b3..b3154dcdaec 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -3371,6 +3371,7 @@ rest_of_compilation (decl) without updating life info can wind up with Wierd Stuff in global_live_at_end. We then run sched1, which updates things properly, discovers the wierdness and aborts. */ + allocate_bb_life_data (); update_life_info (NULL, UPDATE_LIFE_GLOBAL_RM_NOTES, PROP_DEATH_NOTES | PROP_KILL_DEAD_CODE | PROP_SCAN_DEAD_CODE); -- 2.30.2