flow.c (redirect_edge_and_branch_force): Initialize global_live_at_start and global_l...
authorRichard Henderson <rth@redhat.com>
Sun, 15 Jul 2001 15:47:05 +0000 (08:47 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Sun, 15 Jul 2001 15:47:05 +0000 (08:47 -0700)
        * 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
gcc/basic-block.h
gcc/flow.c
gcc/toplev.c

index c9f6acd2579d8449cef2607d388252f2e157685b..90761024ad095dbe61349ea0de2c7182471b75a8 100644 (file)
@@ -1,3 +1,11 @@
+2001-07-15  Richard Henderson  <rth@redhat.com>
+
+       * 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  <rth@redhat.com>
 
        * config/alpha/alpha.c (alpha_tablejump_addr_vec): New.
index fc5907387051d22a02820834ca2e4ec66e13f6bc..656c13b980177e2d40fc9350eafb3e07f04536cb 100644 (file)
@@ -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
index ecaf9ea9cd5ab72a3fe44522d3b430ee8247edcb..56b40f0e625a8806fbadf3a361817b81a78137fa 100644 (file)
@@ -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;
index 416187275b38d999e89cad2fd3f5971e5a7540da..b3154dcdaec7703179b676fb09a1367bb078a44d 100644 (file)
@@ -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);