OSDN Git Service

* Makefile.in (start.encap): Do not depend on LIBGCC1.
[pf3gnuchains/gcc-fork.git] / gcc / ssa.c
index b10c46f..979f111 100644 (file)
--- a/gcc/ssa.c
+++ b/gcc/ssa.c
@@ -147,11 +147,11 @@ static int rename_equivalent_regs_in_insn
 static int coalesce_if_unconflicting
   PARAMS ((partition p, conflict_graph conflicts, int reg1, int reg2));
 static int coalesce_regs_in_copies
-  PARAMS ((int bb, partition p, conflict_graph conflicts));
+  PARAMS ((basic_block bb, partition p, conflict_graph conflicts));
 static int coalesce_reg_in_phi
   PARAMS ((rtx, int dest_regno, int src_regno, void *data));
 static int coalesce_regs_in_successor_phi_nodes
-  PARAMS ((int bb, partition p, conflict_graph conflicts));
+  PARAMS ((basic_block bb, partition p, conflict_graph conflicts));
 static partition compute_coalesced_reg_partition
   PARAMS (());
 static int mark_reg_in_phi 
@@ -855,14 +855,8 @@ convert_to_ssa()
   if (in_ssa_form)
     abort ();
 
-  find_basic_blocks (get_insns (), max_reg_num(), NULL);
-  /* The dominator algorithms assume all blocks are reachable; clean
-     up first.  */
-  cleanup_cfg (get_insns ());
-  /* Don't eliminate dead code here.  The CFG we computed above must
-     remain unchanged until we are finished emerging from SSA form --
-     the phi node representation depends on it.  */
-  life_analysis (get_insns (), max_reg_num (), NULL, 0);
+  /* Need global_live_at_{start,end} up to date.  */
+  life_analysis (get_insns (), NULL, PROP_KILL_DEAD_CODE | PROP_SCAN_DEAD_CODE);
 
   /* Compute dominators.  */
   dominators = sbitmap_vector_alloc (n_basic_blocks, n_basic_blocks);
@@ -930,8 +924,6 @@ convert_to_ssa()
   in_ssa_form = 1;
 
   reg_scan (get_insns (), max_reg_num (), 1);
-  find_basic_blocks (get_insns (), max_reg_num (), NULL);
-  life_analysis (get_insns (), max_reg_num (), NULL, 0);
 }
 
 
@@ -1460,16 +1452,16 @@ coalesce_if_unconflicting (p, conflicts, reg1, reg2)
 
 static int
 coalesce_regs_in_copies (bb, p, conflicts)
-     int bb;
+     basic_block bb;
      partition p;
      conflict_graph conflicts;
 {
   int changed = 0;
   rtx insn;
-  rtx end = BLOCK_END (bb);
+  rtx end = bb->end;
 
   /* Scan the instruction stream of the block.  */
-  for (insn = BLOCK_HEAD (bb); insn != end; insn = NEXT_INSN (insn))
+  for (insn = bb->head; insn != end; insn = NEXT_INSN (insn))
     {
       rtx pattern;
       rtx src;
@@ -1557,7 +1549,7 @@ coalesce_reg_in_phi (insn, dest_regno, src_regno, data)
 
 static int
 coalesce_regs_in_successor_phi_nodes (bb, p, conflicts)
-     int bb;
+     basic_block bb;
      partition p;
      conflict_graph conflicts;
 {
@@ -1616,8 +1608,10 @@ compute_coalesced_reg_partition ()
         order will generate correct, if non-optimal, results.  */
       for (bb = n_basic_blocks; --bb >= 0; )
        {
-         changed += coalesce_regs_in_copies (bb, p, conflicts);
-         changed += coalesce_regs_in_successor_phi_nodes (bb, p, conflicts);
+         basic_block block = BASIC_BLOCK (bb);
+         changed += coalesce_regs_in_copies (block, p, conflicts);
+         changed += 
+           coalesce_regs_in_successor_phi_nodes (block, p, conflicts);
        }
 
       conflict_graph_delete (conflicts);
@@ -1817,9 +1811,8 @@ convert_from_ssa()
   partition reg_partition;
   rtx insns = get_insns ();
     
-  /* We need up-to-date life information.  */
-  find_basic_blocks (insns, max_reg_num (), NULL);
-  life_analysis (insns, max_reg_num (), NULL, 0);
+  /* Need global_live_at_{start,end} up to date.  */
+  life_analysis (insns, NULL, PROP_KILL_DEAD_CODE | PROP_SCAN_DEAD_CODE);
 
   /* Figure out which regs in copies and phi nodes don't conflict and
      therefore can be coalesced.  */
@@ -1885,28 +1878,23 @@ convert_from_ssa()
 
 int
 for_each_successor_phi (bb, fn, data)
-     int bb;
+     basic_block bb;
      successor_phi_fn fn;
      void *data;
 {
-  basic_block block;
   edge e;
   
-  if (bb == EXIT_BLOCK)
+  if (bb == EXIT_BLOCK_PTR)
     return 0;
-  else if (bb == ENTRY_BLOCK)
-    block = ENTRY_BLOCK_PTR;
-  else
-    block = BASIC_BLOCK (bb);
 
   /* Scan outgoing edges.  */
-  for (e = block->succ; e != NULL; e = e->succ_next)
+  for (e = bb->succ; e != NULL; e = e->succ_next)
     {
       rtx insn;
 
       basic_block successor = e->dest;
-      if (successor->index == ENTRY_BLOCK 
-         || successor->index == EXIT_BLOCK)
+      if (successor == ENTRY_BLOCK_PTR 
+         || successor == EXIT_BLOCK_PTR)
        continue;
 
       /* Advance to the first non-label insn of the successor block.  */
@@ -1924,7 +1912,7 @@ for_each_successor_phi (bb, fn, data)
        {
          int result;
          rtx phi_set = PATTERN (insn);
-         rtx *alternative = phi_alternative (phi_set, block->index);
+         rtx *alternative = phi_alternative (phi_set, bb->index);
          rtx phi_src;
          
          /* This phi function may not have an alternative