(reg_changes_size): New variable.

(allocate_for_life_analysis): Allocate and initialize it.
(mark_used_regs, case SUBREG): Set it.

From-SVN: r7864
This commit is contained in:
Richard Kenner 1994-08-07 08:51:03 -04:00
parent ffceec83e4
commit 80f8f04ad1
1 changed files with 21 additions and 0 deletions

View 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. */