OSDN Git Service

* config/h8300/h8300.md (a peephole2): Remove useless code.
[pf3gnuchains/gcc-fork.git] / gcc / ra-rewrite.c
index 2dfe12b..5cb1bb9 100644 (file)
@@ -1,5 +1,5 @@
 /* Graph coloring register allocator
-   Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
    Contributed by Michael Matz <matz@suse.de>
    and Daniel Berlin <dan@cgsoftware.com>.
 
@@ -20,6 +20,8 @@
 
 #include "config.h"
 #include "system.h"
+#include "coretypes.h"
+#include "tm.h"
 #include "rtl.h"
 #include "tm_p.h"
 #include "function.h"
@@ -57,7 +59,7 @@ static void delete_overlapping_slots PARAMS ((struct rtx_list **, rtx));
 static int slot_member_p PARAMS ((struct rtx_list *, rtx));
 static void insert_stores PARAMS ((bitmap));
 static int spill_same_color_p PARAMS ((struct web *, struct web *));
-static int is_partly_live_1 PARAMS ((sbitmap, struct web *));
+static bool is_partly_live_1 PARAMS ((sbitmap, struct web *));
 static void update_spill_colors PARAMS ((HARD_REG_SET *, struct web *, int));
 static int spill_is_free PARAMS ((HARD_REG_SET *, struct web *));
 static void emit_loads PARAMS ((struct rewrite_info *, int, rtx));
@@ -550,7 +552,7 @@ remember_slot (list, x)
 }
 
 /* Given two rtx' S1 and S2, either being REGs or MEMs (or SUBREGs
-   thereof), return non-zero, if they overlap.  REGs and MEMs don't
+   thereof), return nonzero, if they overlap.  REGs and MEMs don't
    overlap, and if they are MEMs they must have an easy address
    (plus (basereg) (const_inst x)), otherwise they overlap.  */
 
@@ -666,9 +668,11 @@ insert_stores (new_deaths)
       if (uid < insn_df_max_uid)
        {
          unsigned int n;
-         struct ra_insn_info info = insn_df[uid];
          rtx following = NEXT_INSN (insn);
          basic_block bb = BLOCK_FOR_INSN (insn);
+         struct ra_insn_info info;
+
+         info = insn_df[uid];
          for (n = 0; n < info.num_defs; n++)
            {
              struct web *web = def2web[DF_REF_ID (info.defs[n])];
@@ -768,7 +772,7 @@ spill_same_color_p (web1, web2)
 /* Given the set of live web IDs LIVE, returns nonzero, if any of WEBs
    subwebs (or WEB itself) is live.  */
 
-static int
+static bool
 is_partly_live_1 (live, web)
      sbitmap live;
      struct web *web;
@@ -1081,7 +1085,7 @@ static void
 rewrite_program2 (new_deaths)
      bitmap new_deaths;
 {
-  basic_block bb;
+  basic_block bb = NULL;
   int nl_first_reload;
   struct rewrite_info ri;
   rtx insn;
@@ -1485,7 +1489,7 @@ detect_web_parts_to_rebuild ()
   sbitmap_zero (already_webs);
   /* We need to recheck all uses of all webs involved in spilling (and the
      uses added by spill insns, but those are not analyzed yet).
-     Those are the spilled webs themself, webs coalesced to spilled ones,
+     Those are the spilled webs themselves, webs coalesced to spilled ones,
      and webs conflicting with any of them.  */
   for (pass = 0; pass < 2; pass++)
     for (d = (pass == 0) ? WEBS(SPILLED) : WEBS(COALESCED); d; d = d->next)
@@ -1882,7 +1886,7 @@ delete_moves ()
       }
 }
 
-/* Due to resons documented elsewhere we create different pseudos
+/* Due to reasons documented elsewhere we create different pseudos
    for all webs coalesced to hardregs.  For these parts life_analysis()
    might have added REG_DEAD notes without considering, that only this part
    but not the whole coalesced web dies.  The RTL is correct, there is no
@@ -1949,20 +1953,18 @@ void
 dump_cost (level)
      unsigned int level;
 {
-#define LU HOST_WIDE_INT_PRINT_UNSIGNED
   ra_debug_msg (level, "Instructions for spilling\n added:\n");
-  ra_debug_msg (level, "  loads =%d cost=" LU "\n", emitted_spill_loads,
-            spill_load_cost);
-  ra_debug_msg (level, "  stores=%d cost=" LU "\n", emitted_spill_stores,
-            spill_store_cost);
-  ra_debug_msg (level, "  remat =%d cost=" LU "\n", emitted_remat,
-            spill_remat_cost);
-  ra_debug_msg (level, " removed:\n");
-  ra_debug_msg (level, "  moves =%d cost=" LU "\n", deleted_move_insns,
-            deleted_move_cost);
-  ra_debug_msg (level, "  others=%d cost=" LU "\n", deleted_def_insns,
-            deleted_def_cost);
-#undef LU
+  ra_debug_msg (level, "  loads =%d cost=", emitted_spill_loads);
+  ra_debug_msg (level, HOST_WIDE_INT_PRINT_UNSIGNED, spill_load_cost);
+  ra_debug_msg (level, "\n  stores=%d cost=", emitted_spill_stores);
+  ra_debug_msg (level, HOST_WIDE_INT_PRINT_UNSIGNED, spill_store_cost);
+  ra_debug_msg (level, "\n  remat =%d cost=", emitted_remat);
+  ra_debug_msg (level, HOST_WIDE_INT_PRINT_UNSIGNED, spill_remat_cost);
+  ra_debug_msg (level, "\n removed:\n  moves =%d cost=", deleted_move_insns);
+  ra_debug_msg (level, HOST_WIDE_INT_PRINT_UNSIGNED, deleted_move_cost);
+  ra_debug_msg (level, "\n  others=%d cost=", deleted_def_insns);
+  ra_debug_msg (level, HOST_WIDE_INT_PRINT_UNSIGNED, deleted_def_cost);
+  ra_debug_msg (level, "\n");
 }
 
 /* Initialization of the rewrite phase.  */