]> gcc.gnu.org Git - gcc.git/commitdiff
(reg_changes_size): New variable.
authorRichard Kenner <kenner@gcc.gnu.org>
Sun, 7 Aug 1994 12:51:03 +0000 (08:51 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Sun, 7 Aug 1994 12:51:03 +0000 (08:51 -0400)
(allocate_for_life_analysis): Allocate and initialize it.
(mark_used_regs, case SUBREG): Set it.

From-SVN: r7864

gcc/flow.c

index cc9fed91cf3c6dc110f462ae35f3fb741598f82c..db4f37f64e3c5808652c0e6a4a1407a754973f93 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.  */
This page took 0.06857 seconds and 5 git commands to generate.