OSDN Git Service

(reg_changes_size): New variable.
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 7 Aug 1994 12:51:03 +0000 (12:51 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 7 Aug 1994 12:51:03 +0000 (12:51 +0000)
(allocate_for_life_analysis): Allocate and initialize it.
(mark_used_regs, case SUBREG): Set it.

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

gcc/flow.c

index cc9fed9..db4f37f 100644 (file)
@@ -177,6 +177,12 @@ int *reg_basic_block;
 
 int *reg_n_refs;
 
+/* Indexed by N; says whether a psuedo register N was ever used
+   within a SUBREG that changes the size of the reg.  Some machines prohibit
+   such objects to be in certain (usually floating-point) registers.  */
+
+char *reg_changes_size;
+
 /* Indexed by N, gives number of places register N dies.
    This information remains valid for the rest of the compilation
    of the current function; it is used to control register allocation.  */
@@ -1183,6 +1189,9 @@ allocate_for_life_analysis ()
   reg_n_deaths = (short *) oballoc (max_regno * sizeof (short));
   bzero ((char *) reg_n_deaths, max_regno * sizeof (short));
 
+  reg_changes_size = (char *) oballoc (max_regno * sizeof (char));
+  bzero (reg_changes_size, max_regno * sizeof (char));;
+
   reg_live_length = (int *) oballoc (max_regno * sizeof (int));
   bzero ((char *) reg_live_length, max_regno * sizeof (int));
 
@@ -2257,6 +2266,18 @@ mark_used_regs (needed, live, x, final, insn)
 #endif
       break;
 
+    case SUBREG:
+      if (GET_CODE (SUBREG_REG (x)) == REG
+         && REGNO (SUBREG_REG (x)) >= FIRST_PSEUDO_REGISTER
+         && (GET_MODE_SIZE (GET_MODE (x))
+             != GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)))))
+       reg_changes_size[REGNO (SUBREG_REG (x))] = 1;
+
+      /* While we're here, optimize this case.  */
+      x = SUBREG_REG (x);
+
+      /* ... fall through ... */
+
     case REG:
       /* See a register other than being set
         => mark it as needed.  */