OSDN Git Service

* gcc.c-torture/execute/builtin-abs-1.c
[pf3gnuchains/gcc-fork.git] / gcc / conflict.c
index 0aec927..dd6e2a1 100644 (file)
@@ -148,8 +148,7 @@ arc_eq (const void *arcp1, const void *arcp2)
 conflict_graph
 conflict_graph_new (int num_regs)
 {
-  conflict_graph graph
-    = (conflict_graph) xmalloc (sizeof (struct conflict_graph_def));
+  conflict_graph graph = xmalloc (sizeof (struct conflict_graph_def));
   graph->num_regs = num_regs;
 
   /* Set up the hash table.  No delete action is specified; memory
@@ -161,10 +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
-    = (conflict_graph_arc *) 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;
 }
 
@@ -206,8 +203,7 @@ conflict_graph_add (conflict_graph graph, int reg1, int reg2)
 
   /* Allocate an arc.  */
   arc
-    = (conflict_graph_arc)
-      obstack_alloc (&graph->arc_obstack,
+    = obstack_alloc (&graph->arc_obstack,
                     sizeof (struct conflict_graph_arc_def));
   
   /* Record the reg numbers.  */
@@ -380,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));
@@ -439,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;