OSDN Git Service

2010-07-05 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / ira.c
index 4fac13c..0f0b70a 100644 (file)
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -331,9 +331,6 @@ int internal_flag_ira_verbose;
 /* Dump file of the allocator if it is not NULL.  */
 FILE *ira_dump_file;
 
-/* Pools for allocnos, copies, allocno live ranges.  */
-alloc_pool allocno_pool, copy_pool, allocno_live_range_pool;
-
 /* The number of elements in the following array.  */
 int ira_spilled_reg_stack_slots_num;
 
@@ -358,9 +355,10 @@ HARD_REG_SET eliminable_regset;
    of given mode starting with given hard register.  */
 HARD_REG_SET ira_reg_mode_hard_regset[FIRST_PSEUDO_REGISTER][NUM_MACHINE_MODES];
 
-/* The following two variables are array analogs of the macros
-   MEMORY_MOVE_COST and REGISTER_MOVE_COST.  */
+/* Array analogous to target hook TARGET_MEMORY_MOVE_COST.  */
 short int ira_memory_move_cost[MAX_MACHINE_MODE][N_REG_CLASSES][2];
+
+/* Array based on TARGET_REGISTER_MOVE_COST.  */
 move_table *ira_register_move_cost[MAX_MACHINE_MODE];
 
 /* Similar to may_move_in_cost but it is calculated in IRA instead of
@@ -527,11 +525,11 @@ setup_class_subset_and_memory_move_costs (void)
        for (mode = 0; mode < MAX_MACHINE_MODE; mode++)
          {
            ira_memory_move_cost[mode][cl][0] =
-             MEMORY_MOVE_COST ((enum machine_mode) mode,
-                               (enum reg_class) cl, 0);
+             memory_move_cost ((enum machine_mode) mode,
+                               (enum reg_class) cl, false);
            ira_memory_move_cost[mode][cl][1] =
-             MEMORY_MOVE_COST ((enum machine_mode) mode,
-                               (enum reg_class) cl, 1);
+             memory_move_cost ((enum machine_mode) mode,
+                               (enum reg_class) cl, true);
            /* Costs for NO_REGS are used in cost calculation on the
               1st pass when the preferred register classes are not
               known yet.  In this case we take the best scenario.  */
@@ -742,7 +740,7 @@ setup_cover_and_important_classes (void)
 {
   int i, j, n, cl;
   bool set_p;
-  const enum reg_class *cover_classes;
+  const reg_class_t *cover_classes;
   HARD_REG_SET temp_hard_regset2;
   static enum reg_class classes[LIM_REG_CLASSES + 1];
 
@@ -1585,12 +1583,8 @@ find_reg_equiv_invariant_const (void)
 
          x = XEXP (note, 0);
 
-         if (! function_invariant_p (x)
-             || ! flag_pic
-             /* A function invariant is often CONSTANT_P but may
-                include a register.  We promise to only pass CONSTANT_P
-                objects to LEGITIMATE_PIC_OPERAND_P.  */
-             || (CONSTANT_P (x) && LEGITIMATE_PIC_OPERAND_P (x)))
+         if (! CONSTANT_P (x)
+             || ! flag_pic || LEGITIMATE_PIC_OPERAND_P (x))
            {
              /* It can happen that a REG_EQUIV note contains a MEM
                 that is not a legitimate memory operand.  As later
@@ -1790,8 +1784,7 @@ fix_reg_equiv_init (void)
 
   if (reg_equiv_init_size < max_regno)
     {
-      reg_equiv_init
-       = (rtx *) ggc_realloc (reg_equiv_init, max_regno * sizeof (rtx));
+      reg_equiv_init = GGC_RESIZEVEC (rtx, reg_equiv_init, max_regno);
       while (reg_equiv_init_size < max_regno)
        reg_equiv_init[reg_equiv_init_size++] = NULL_RTX;
       for (i = FIRST_PSEUDO_REGISTER; i < reg_equiv_init_size; i++)
@@ -2370,7 +2363,7 @@ update_equiv_regs (void)
   recorded_label_ref = 0;
 
   reg_equiv = XCNEWVEC (struct equivalence, max_regno);
-  reg_equiv_init = GGC_CNEWVEC (rtx, max_regno);
+  reg_equiv_init = ggc_alloc_cleared_vec_rtx (max_regno);
   reg_equiv_init_size = max_regno;
 
   init_alias_analysis ();