aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-08-07 08:51:03 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1994-08-07 08:51:03 -0400
commit80f8f04ad15566e8bf9ef95b458d83a1a1586637 (patch)
tree24d5138196367d6ce74fbc180e560cc6e9203427
parentffceec83e49688e6081299ed6d35d03dffdf3b7e (diff)
downloadgcc-80f8f04ad15566e8bf9ef95b458d83a1a1586637.zip
gcc-80f8f04ad15566e8bf9ef95b458d83a1a1586637.tar.gz
gcc-80f8f04ad15566e8bf9ef95b458d83a1a1586637.tar.bz2
(reg_changes_size): New variable.
(allocate_for_life_analysis): Allocate and initialize it. (mark_used_regs, case SUBREG): Set it. From-SVN: r7864
-rw-r--r--gcc/flow.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/flow.c b/gcc/flow.c
index cc9fed9..db4f37f 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -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. */