OSDN Git Service

2004-10-04 Jose Ruiz <ruiz@act-europe.fr>
[pf3gnuchains/gcc-fork.git] / gcc / conflict.c
index 9b63773..31886fa 100644 (file)
@@ -160,9 +160,8 @@ conflict_graph_new (int num_regs)
   obstack_init (&graph->arc_obstack);
             
   /* Create and zero the lookup table by register number.  */
-  graph->neighbor_heads = xmalloc (num_regs * sizeof (conflict_graph_arc));
+  graph->neighbor_heads = xcalloc (num_regs, sizeof (conflict_graph_arc));
 
-  memset (graph->neighbor_heads, 0, num_regs * sizeof (conflict_graph_arc));
   return graph;
 }
 
@@ -191,8 +190,7 @@ conflict_graph_add (conflict_graph graph, int reg1, int reg2)
   void **slot;
 
   /* A reg cannot conflict with itself.  */
-  if (reg1 == reg2)
-    abort ();
+  gcc_assert (reg1 != reg2);
 
   dummy.smaller = smaller;
   dummy.larger = larger;
@@ -325,10 +323,11 @@ print_conflict (int reg1, int reg2, void *contextp)
      is the interesting one.  */
   if (reg1 == context->reg)
     reg = reg2;
-  else if (reg2 == context->reg)
-    reg = reg1;
   else
-    abort ();
+    {
+      gcc_assert (reg2 == context->reg);
+      reg = reg1;
+    }
 
   /* Print the conflict.  */
   fprintf (context->fp, " %d", reg);
@@ -377,7 +376,7 @@ mark_reg (rtx reg, rtx setter ATTRIBUTE_UNUSED, void *data)
     reg = SUBREG_REG (reg);
 
   /* We're only interested in regs.  */
-  if (GET_CODE (reg) != REG)
+  if (!REG_P (reg))
     return;
 
   SET_REGNO_REG_SET (set, REGNO (reg));
@@ -436,9 +435,9 @@ conflict_graph_compute (regset regs, partition p)
       AND_REG_SET (live, regs);
 
       /* Walk the instruction stream backwards.  */
-      head = bb->head;
-      insn = bb->end;
-      for (insn = bb->end; insn != head; insn = PREV_INSN (insn))
+      head = BB_HEAD (bb);
+      insn = BB_END (bb);
+      for (insn = BB_END (bb); insn != head; insn = PREV_INSN (insn))
        {
          int born_reg;
          int live_reg;