OSDN Git Service

* flags.h (g_switch_value): Change to an unsigned
[pf3gnuchains/gcc-fork.git] / gcc / resource.c
index 6c20517..f542460 100644 (file)
@@ -20,6 +20,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 #include "config.h"
 #include "system.h"
+#include "coretypes.h"
+#include "tm.h"
 #include "toplev.h"
 #include "rtl.h"
 #include "tm_p.h"
@@ -133,7 +135,7 @@ find_basic_block (insn, search_limit)
      rtx insn;
      int search_limit;
 {
-  int i;
+  basic_block bb;
 
   /* Scan backwards to the previous BARRIER.  Then see if we can find a
      label that starts a basic block.  Return the basic block number.  */
@@ -146,9 +148,9 @@ find_basic_block (insn, search_limit)
   if (search_limit == 0)
     return -1;
 
-  /* The start of the function is basic block zero.  */
+  /* The start of the function.  */
   else if (insn == 0)
-    return 0;
+    return ENTRY_BLOCK_PTR->next_bb->index;
 
   /* See if any of the upcoming CODE_LABELs start a basic block.  If we reach
      anything other than a CODE_LABEL or note, we can't find this code.  */
@@ -156,9 +158,9 @@ find_basic_block (insn, search_limit)
        insn && GET_CODE (insn) == CODE_LABEL;
        insn = next_nonnote_insn (insn))
     {
-      for (i = 0; i < n_basic_blocks; i++)
-       if (insn == BLOCK_HEAD (i))
-         return i;
+      FOR_EACH_BB (bb)
+       if (insn == bb->head)
+         return bb->index;
     }
 
   return -1;
@@ -372,7 +374,7 @@ mark_referenced_resources (x, res, include_delayed_effects)
             We assume that they both use and set all registers.  Using all
             registers ensures that a register will not be considered dead
             just because it crosses a setjmp call.  A register should be
-            considered dead only if the setjmp call returns non-zero.  */
+            considered dead only if the setjmp call returns nonzero.  */
          if (find_reg_note (x, REG_SETJMP, NULL))
            SET_HARD_REG_SET (res->regs);
 
@@ -1178,7 +1180,7 @@ init_resource_info (epilogue_insn)
   /* Indicate what resources are required to be valid at the end of the current
      function.  The condition code never is and memory always is.  If the
      frame pointer is needed, it is and so is the stack pointer unless
-     EXIT_IGNORE_STACK is non-zero.  If the frame pointer is not needed, the
+     EXIT_IGNORE_STACK is nonzero.  If the frame pointer is not needed, the
      stack pointer is.  Registers used to return the function value are
      needed.  Registers holding global variables are needed.  */
 
@@ -1240,10 +1242,10 @@ init_resource_info (epilogue_insn)
   /* Allocate and initialize the tables used by mark_target_live_regs.  */
   target_hash_table = (struct target_info **)
     xcalloc (TARGET_HASH_PRIME, sizeof (struct target_info *));
-  bb_ticks = (int *) xcalloc (n_basic_blocks, sizeof (int));
+  bb_ticks = (int *) xcalloc (last_basic_block, sizeof (int));
 }
 \f
-/* Free up the resources allcated to mark_target_live_regs ().  This
+/* Free up the resources allocated to mark_target_live_regs ().  This
    should be invoked after the last call to mark_target_live_regs ().  */
 
 void