OSDN Git Service

2006-04-18 Paolo Bonzini <bonzini@gnu.org>
authorbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Apr 2006 08:23:39 +0000 (08:23 +0000)
committerbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Apr 2006 08:23:39 +0000 (08:23 +0000)
        PR target/27117

Partial revert of revision 112637
2006-04-03  Paolo Bonzini  <bonzini@gnu.org>
    Dale Johannesen  <dalej@apple.com>

PR target/19653
* regclass.c (struct reg_pref): Update documentation.
(regclass): Set prefclass to NO_REGS if memory is the best option.
(record_reg_classes): Cope with a prefclass set to NO_REGS.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113026 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/regclass.c

index 2d26302..8574f89 100644 (file)
@@ -1,5 +1,18 @@
 2006-04-18  Paolo Bonzini  <bonzini@gnu.org>
 
+        PR target/27117
+
+       Partial revert of revision 112637
+       2006-04-03  Paolo Bonzini  <bonzini@gnu.org>
+                   Dale Johannesen  <dalej@apple.com>
+
+       PR target/19653
+       * regclass.c (struct reg_pref): Update documentation.
+       (regclass): Set prefclass to NO_REGS if memory is the best option.
+       (record_reg_classes): Cope with a prefclass set to NO_REGS.
+
+2006-04-18  Paolo Bonzini  <bonzini@gnu.org>
+
         PR tree-optimization/26821
         * tree-ssa-math-opts.c (get_constant_one): New.
         (insert_reciprocals): Use it.
index 8a0bab1..7b2d5b1 100644 (file)
@@ -811,8 +811,7 @@ struct costs
 /* Structure used to record preferences of given pseudo.  */
 struct reg_pref
 {
-  /* (enum reg_class) prefclass is the preferred class.  May be
-     NO_REGS if no class is better than memory.  */
+  /* (enum reg_class) prefclass is the preferred class.  */
   char prefclass;
 
   /* altclass is a register class that we should use for allocating
@@ -1315,10 +1314,6 @@ regclass (rtx f, int nregs)
                best = reg_class_subunion[(int) best][class];
            }
 
-         /* If no register class is better than memory, use memory. */
-         if (p->mem_cost < best_cost)
-           best = NO_REGS;
-
          /* Record the alternate register class; i.e., a class for which
             every register in it is better than using memory.  If adding a
             class would make a smaller class (i.e., no union of just those
@@ -1529,7 +1524,7 @@ record_reg_classes (int n_alts, int n_ops, rtx *ops,
                     to what we would add if this register were not in the
                     appropriate class.  */
 
-                 if (reg_pref && reg_pref[REGNO (op)].prefclass != NO_REGS)
+                 if (reg_pref)
                    alt_cost
                      += (may_move_in_cost[mode]
                          [(unsigned char) reg_pref[REGNO (op)].prefclass]
@@ -1755,7 +1750,7 @@ record_reg_classes (int n_alts, int n_ops, rtx *ops,
                     to what we would add if this register were not in the
                     appropriate class.  */
 
-                 if (reg_pref && reg_pref[REGNO (op)].prefclass != NO_REGS)
+                 if (reg_pref)
                    alt_cost
                      += (may_move_in_cost[mode]
                          [(unsigned char) reg_pref[REGNO (op)].prefclass]
@@ -1841,8 +1836,7 @@ record_reg_classes (int n_alts, int n_ops, rtx *ops,
          int class;
          unsigned int nr;
 
-         if (regno >= FIRST_PSEUDO_REGISTER && reg_pref != 0
-             && reg_pref[regno].prefclass != NO_REGS)
+         if (regno >= FIRST_PSEUDO_REGISTER && reg_pref != 0)
            {
              enum reg_class pref = reg_pref[regno].prefclass;