OSDN Git Service

Correct the date for my last ChangeLog entry.
[pf3gnuchains/gcc-fork.git] / gcc / resource.c
index a536dd9..ce86aaf 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions for computing resource usage of specific insns.
-   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
+   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -27,7 +27,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "rtl.h"
 #include "tm_p.h"
 #include "hard-reg-set.h"
-#include "basic-block.h"
 #include "function.h"
 #include "regs.h"
 #include "flags.h"
@@ -233,8 +232,7 @@ mark_referenced_resources (rtx x, struct resources *res,
          unsigned int last_regno
            = regno + hard_regno_nregs[regno][GET_MODE (x)];
 
-         if (last_regno > FIRST_PSEUDO_REGISTER)
-           abort ();
+         gcc_assert (last_regno <= FIRST_PSEUDO_REGISTER);
          for (r = regno; r < last_regno; r++)
            SET_HARD_REG_BIT (res->regs, r);
        }
@@ -246,8 +244,7 @@ mark_referenced_resources (rtx x, struct resources *res,
          unsigned int last_regno
            = regno + hard_regno_nregs[regno][GET_MODE (x)];
 
-         if (last_regno > FIRST_PSEUDO_REGISTER)
-           abort ();
+         gcc_assert (last_regno <= FIRST_PSEUDO_REGISTER);
          for (r = regno; r < last_regno; r++)
            SET_HARD_REG_BIT (res->regs, r);
        }
@@ -256,7 +253,7 @@ mark_referenced_resources (rtx x, struct resources *res,
     case MEM:
       /* If this memory shouldn't change, it really isn't referencing
         memory.  */
-      if (RTX_UNCHANGING_P (x))
+      if (MEM_READONLY_P (x))
        res->unch_memory = 1;
       else
        res->memory = 1;
@@ -302,13 +299,12 @@ mark_referenced_resources (rtx x, struct resources *res,
     case SET:
       /* Usually, the first operand of SET is set, not referenced.  But
         registers used to access memory are referenced.  SET_DEST is
-        also referenced if it is a ZERO_EXTRACT or SIGN_EXTRACT.  */
+        also referenced if it is a ZERO_EXTRACT.  */
 
       mark_referenced_resources (SET_SRC (x), res, 0);
 
       x = SET_DEST (x);
-      if (GET_CODE (x) == SIGN_EXTRACT
-         || GET_CODE (x) == ZERO_EXTRACT
+      if (GET_CODE (x) == ZERO_EXTRACT
          || GET_CODE (x) == STRICT_LOW_PART)
        mark_referenced_resources (x, res, 0);
       else if (GET_CODE (x) == SUBREG)
@@ -340,8 +336,7 @@ mark_referenced_resources (rtx x, struct resources *res,
            {
              sequence = PATTERN (NEXT_INSN (insn));
              seq_size = XVECLEN (sequence, 0);
-             if (GET_CODE (sequence) != SEQUENCE)
-               abort ();
+             gcc_assert (GET_CODE (sequence) == SEQUENCE);
            }
 
          res->memory = 1;
@@ -753,7 +748,7 @@ mark_set_resources (rtx x, struct resources *res, int in_dest,
       if (in_dest)
        {
          res->memory = 1;
-         res->unch_memory |= RTX_UNCHANGING_P (x);
+         res->unch_memory |= MEM_READONLY_P (x);
          res->volatil |= MEM_VOLATILE_P (x);
        }
 
@@ -771,8 +766,7 @@ mark_set_resources (rtx x, struct resources *res, int in_dest,
              unsigned int last_regno
                = regno + hard_regno_nregs[regno][GET_MODE (x)];
 
-             if (last_regno > FIRST_PSEUDO_REGISTER)
-               abort ();
+             gcc_assert (last_regno <= FIRST_PSEUDO_REGISTER);
              for (r = regno; r < last_regno; r++)
                SET_HARD_REG_BIT (res->regs, r);
            }
@@ -786,8 +780,7 @@ mark_set_resources (rtx x, struct resources *res, int in_dest,
          unsigned int last_regno
            = regno + hard_regno_nregs[regno][GET_MODE (x)];
 
-         if (last_regno > FIRST_PSEUDO_REGISTER)
-           abort ();
+         gcc_assert (last_regno <= FIRST_PSEUDO_REGISTER);
          for (r = regno; r < last_regno; r++)
            SET_HARD_REG_BIT (res->regs, r);
        }
@@ -976,6 +969,7 @@ mark_target_live_regs (rtx insns, rtx target, struct resources *res)
       unsigned int j;
       unsigned int regno;
       rtx start_insn, stop_insn;
+      reg_set_iterator rsi;
 
       /* Compute hard regs live at start of block -- this is the real hard regs
         marked live, plus live pseudo regs that have been renumbered to
@@ -983,19 +977,17 @@ mark_target_live_regs (rtx insns, rtx target, struct resources *res)
 
       REG_SET_TO_HARD_REG_SET (current_live_regs, regs_live);
 
-      EXECUTE_IF_SET_IN_REG_SET
-       (regs_live, FIRST_PSEUDO_REGISTER, i,
-        {
-          if (reg_renumber[i] >= 0)
-            {
-              regno = reg_renumber[i];
-              for (j = regno;
-                   j < regno + hard_regno_nregs[regno]
-                                               [PSEUDO_REGNO_MODE (i)];
-                   j++)
-                SET_HARD_REG_BIT (current_live_regs, j);
-            }
-        });
+      EXECUTE_IF_SET_IN_REG_SET (regs_live, FIRST_PSEUDO_REGISTER, i, rsi)
+       {
+         if (reg_renumber[i] >= 0)
+           {
+             regno = reg_renumber[i];
+             for (j = regno;
+                  j < regno + hard_regno_nregs[regno][PSEUDO_REGNO_MODE (i)];
+                  j++)
+               SET_HARD_REG_BIT (current_live_regs, j);
+           }
+       }
 
       /* Get starting and ending insn, handling the case where each might
         be a SEQUENCE.  */