OSDN Git Service

* config/sh/sh.c (sh_use_dfa_interface): Add TARGET_SH1.
[pf3gnuchains/gcc-fork.git] / gcc / ra-build.c
index 896570e..ba35490 100644 (file)
@@ -1,5 +1,5 @@
 /* Graph coloring register allocator
-   Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
    Contributed by Michael Matz <matz@suse.de>
    and Daniel Berlin <dan@cgsoftware.com>
 
@@ -259,13 +259,13 @@ copy_insn_p (rtx insn, rtx *source, rtx *target)
      coalescing (the check for this is in remember_move() below).  */
   while (GET_CODE (d) == STRICT_LOW_PART)
     d = XEXP (d, 0);
-  if (GET_CODE (d) != REG
-      && (GET_CODE (d) != SUBREG || GET_CODE (SUBREG_REG (d)) != REG))
+  if (!REG_P (d)
+      && (GET_CODE (d) != SUBREG || !REG_P (SUBREG_REG (d))))
     return 0;
   while (GET_CODE (s) == STRICT_LOW_PART)
     s = XEXP (s, 0);
-  if (GET_CODE (s) != REG
-      && (GET_CODE (s) != SUBREG || GET_CODE (SUBREG_REG (s)) != REG))
+  if (!REG_P (s)
+      && (GET_CODE (s) != SUBREG || !REG_P (SUBREG_REG (s))))
     return 0;
 
   s_regno = (unsigned) REGNO (GET_CODE (s) == SUBREG ? SUBREG_REG (s) : s);
@@ -563,7 +563,7 @@ remember_move (rtx insn)
         Those would be difficult to coalesce (we would need to implement
         handling of all the subwebs in the allocator, including that such
         subwebs could be source and target of coalescing).  */
-      if (GET_CODE (s) == REG && GET_CODE (d) == REG)
+      if (REG_P (s) && REG_P (d))
        {
          struct move *m = ra_calloc (sizeof (struct move));
          struct move_list *ml;
@@ -884,7 +884,7 @@ live_in_edge (struct df *df, struct curr_use *use, edge e)
     use->live_over_abnormal = 1;
   bitmap_set_bit (live_at_end[e->src->index], DF_REF_ID (use->wp->ref));
   info_pred = (struct ra_bb_info *) e->src->aux;
-  next_insn = e->src->end;
+  next_insn = BB_END (e->src);
 
   /* If the last insn of the pred. block doesn't completely define the
      current use, we need to check the block.  */
@@ -899,7 +899,7 @@ live_in_edge (struct df *df, struct curr_use *use, edge e)
             creation to later.  */
          bitmap_set_bit (info_pred->live_throughout,
                          DF_REF_ID (use->wp->ref));
-         next_insn = e->src->head;
+         next_insn = BB_HEAD (e->src);
        }
       return next_insn;
     }
@@ -1033,7 +1033,7 @@ livethrough_conflicts_bb (basic_block bb)
   /* First collect the IDs of all defs, count the number of death
      containing insns, and if there's some call_insn here.  */
   all_defs = BITMAP_XMALLOC ();
-  for (insn = bb->head; insn; insn = NEXT_INSN (insn))
+  for (insn = BB_HEAD (bb); insn; insn = NEXT_INSN (insn))
     {
       if (INSN_P (insn))
        {
@@ -1048,13 +1048,15 @@ livethrough_conflicts_bb (basic_block bb)
          if (GET_CODE (insn) == CALL_INSN)
            contains_call = 1;
        }
-      if (insn == bb->end)
+      if (insn == BB_END (bb))
        break;
     }
 
   /* And now, if we have found anything, make all live_through
      uses conflict with all defs, and update their other members.  */
-  if (deaths > 0 || bitmap_first_set_bit (all_defs) >= 0)
+  if (deaths > 0
+      || contains_call
+      || bitmap_first_set_bit (all_defs) >= 0)
     EXECUTE_IF_SET_IN_BITMAP (info->live_throughout, first, use_id,
       {
         struct web_part *wp = &web_parts[df->def_id + use_id];
@@ -1204,7 +1206,7 @@ prune_hardregs_for_mode (HARD_REG_SET *s, enum machine_mode mode)
 static void
 init_one_web_common (struct web *web, rtx reg)
 {
-  if (GET_CODE (reg) != REG)
+  if (!REG_P (reg))
     abort ();
   /* web->id isn't initialized here.  */
   web->regno = REGNO (reg);
@@ -1402,7 +1404,7 @@ init_web_parts (struct df *df)
            num_webs++;
        }
       else
-       /* The last iteration might have left .ref set, while df_analyse()
+       /* The last iteration might have left .ref set, while df_analyze()
           removed that ref (due to a removed copy insn) from the df->defs[]
           array.  As we don't check for that in realloc_web_parts()
           we do that here.  */
@@ -2476,7 +2478,7 @@ contains_pseudo (rtx x)
   int i;
   if (GET_CODE (x) == SUBREG)
     x = SUBREG_REG (x);
-  if (GET_CODE (x) == REG)
+  if (REG_P (x))
     {
       if (REGNO (x) >= FIRST_PSEUDO_REGISTER)
         return 1;
@@ -2595,7 +2597,7 @@ detect_remat_webs (void)
                  we created them ourself.  They might not have set their
                  unchanging flag set, but nevertheless they are stable across
                  the livetime in question.  */
-              || (GET_CODE (src) == MEM
+              || (MEM_P (src)
                   && INSN_UID (insn) >= orig_max_uid
                   && memref_is_stack_slot (src)))
              /* And we must be able to construct an insn without
@@ -2674,10 +2676,10 @@ detect_webs_set_in_cond_jump (void)
 {
   basic_block bb;
   FOR_EACH_BB (bb)
-    if (GET_CODE (bb->end) == JUMP_INSN)
+    if (GET_CODE (BB_END (bb)) == JUMP_INSN)
       {
        struct df_link *link;
-       for (link = DF_INSN_DEFS (df, bb->end); link; link = link->next)
+       for (link = DF_INSN_DEFS (df, BB_END (bb)); link; link = link->next)
          if (link->ref && DF_REF_REGNO (link->ref) >= FIRST_PSEUDO_REGISTER)
            {
              struct web *web = def2web[DF_REF_ID (link->ref)];
@@ -2806,7 +2808,7 @@ handle_asm_insn (struct df *df, rtx insn)
     for (i = 0; i < XVECLEN (pat, 0); i++)
       {
        rtx t = XVECEXP (pat, 0, i);
-       if (GET_CODE (t) == CLOBBER && GET_CODE (XEXP (t, 0)) == REG
+       if (GET_CODE (t) == CLOBBER && REG_P (XEXP (t, 0))
            && REGNO (XEXP (t, 0)) < FIRST_PSEUDO_REGISTER)
          SET_HARD_REG_BIT (clobbered, REGNO (XEXP (t, 0)));
       }
@@ -2831,7 +2833,7 @@ handle_asm_insn (struct df *df, rtx insn)
             || GET_CODE (reg) == SIGN_EXTRACT
             || GET_CODE (reg) == STRICT_LOW_PART)
        reg = XEXP (reg, 0);
-      if (GET_CODE (reg) != REG || REGNO (reg) < FIRST_PSEUDO_REGISTER)
+      if (!REG_P (reg) || REGNO (reg) < FIRST_PSEUDO_REGISTER)
        continue;
 
       /* Search the web corresponding to this operand.  We depend on
@@ -2944,7 +2946,7 @@ handle_asm_insn (struct df *df, rtx insn)
              record_conflict (web, hardreg2web[c]);
 #endif
        }
-      if (rtl_dump_file)
+      if (dump_file)
        {
          int c;
          ra_debug_msg (DUMP_ASM, " ASM constrain Web %d conflicts with:", web->id);