OSDN Git Service

* ifcvt.c (noce_get_alt_condition): Use reg_overlap_mentioned_p.
[pf3gnuchains/gcc-fork.git] / gcc / regclass.c
index 84c7ba3..1451f8a 100644 (file)
@@ -601,11 +601,16 @@ init_regs ()
   init_reg_sets_1 ();
 
   init_reg_modes ();
+}
+
+/* Initialize some fake stack-frame MEM references for use in
+   memory_move_secondary_cost.  */
 
+void
+init_fake_stack_mems ()
+{
 #ifdef HAVE_SECONDARY_RELOADS
   {
-    /* Make some fake stack-frame MEM references for use in
-       memory_move_secondary_cost.  */
     int i;
 
     for (i = 0; i < MAX_MACHINE_MODE; i++)
@@ -819,6 +824,7 @@ globalize_reg (i)
   SET_HARD_REG_BIT (fixed_reg_set, i);
   SET_HARD_REG_BIT (call_used_reg_set, i);
   SET_HARD_REG_BIT (call_fixed_reg_set, i);
+  SET_HARD_REG_BIT (regs_invalidated_by_call, i);
 }
 \f
 /* Now the data and code for the `regclass' pass, which happens
@@ -1311,7 +1317,7 @@ regclass (f, nregs, dump)
 
          /* In non-optimizing compilation REG_N_REFS is not initialized
             yet.  */
-         if (optimize && !REG_N_REFS (i))
+         if (optimize && !REG_N_REFS (i) && !REG_N_SETS (i))
            continue;
 
          for (class = (int) ALL_REGS - 1; class > 0; class--)
@@ -1629,7 +1635,10 @@ record_reg_classes (n_alts, n_ops, ops, modes,
 
              case 'E':
              case 'F':
-               if (GET_CODE (op) == CONST_DOUBLE)
+               if (GET_CODE (op) == CONST_DOUBLE
+                   || (GET_CODE (op) == CONST_VECTOR
+                       && (GET_MODE_CLASS (GET_MODE (op))
+                           == MODE_VECTOR_FLOAT)))
                  win = 1;
                break;
 
@@ -2391,6 +2400,8 @@ reg_scan_mark_refs (x, insn, note_flag, min_regno)
   rtx dest;
   rtx note;
 
+  if (!x)
+    return;
   code = GET_CODE (x);
   switch (code)
     {
@@ -2417,6 +2428,10 @@ reg_scan_mark_refs (x, insn, note_flag, min_regno)
              REGNO_LAST_UID (regno) = INSN_UID (insn);
            if (REGNO_FIRST_UID (regno) == 0)
              REGNO_FIRST_UID (regno) = INSN_UID (insn);
+           /* If we are called by reg_scan_update() (indicated by min_regno
+              being set), we also need to update the reference count.  */
+           if (min_regno)
+             REG_N_REFS (regno)++;
          }
       }
       break;
@@ -2433,6 +2448,18 @@ reg_scan_mark_refs (x, insn, note_flag, min_regno)
        reg_scan_mark_refs (XEXP (x, 1), insn, note_flag, min_regno);
       break;
 
+    case CLOBBER:
+      {
+       rtx reg = XEXP (x, 0);
+       if (REG_P (reg)
+           && REGNO (reg) >= min_regno)
+         {
+           REG_N_SETS (REGNO (reg))++;
+           REG_N_REFS (REGNO (reg))++;
+         }
+      }
+      break;
+
     case SET:
       /* Count a set of the destination if it is a register.  */
       for (dest = SET_DEST (x);