regclass.c (call_really_used_regs): New array for registers which are actually used by a call.

2001-08-01  Andrew MacLeod  <amacleod@redhat.com>

	* regclass.c (call_really_used_regs): New array for registers which
	are actually used by a call.
	(init_reg_sets_1): Initialize regs_invalidated_by_call with the
	new array.
	(fix_register): Set call_really_used too.
	* config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): Initialize.
	* doc/tm.texi (CALL_REALLY_USED_REGISTERS): Document.

From-SVN: r44558
This commit is contained in:
Andrew MacLeod 2001-08-01 21:40:43 +00:00 committed by Andrew Macleod
parent b38b083acf
commit fc1296b77a
4 changed files with 75 additions and 1 deletions

View File

@ -1,3 +1,13 @@
2001-08-01 Andrew MacLeod <amacleod@redhat.com>
* regclass.c (call_really_used_regs): New array for registers which
are actually used by a call.
(init_reg_sets_1): Initialize regs_invalidated_by_call with the
new array.
(fix_register): Set call_really_used too.
* config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): Initialize.
* doc/tm.texi (CALL_REALLY_USED_REGISTERS): Document.
2001-08-01 Richard Henderson <rth@redhat.com>
* read-rtl.c (read_name): Consider \r whitespace.

View File

@ -633,6 +633,45 @@ while (0)
1, 1, 1, 1, 1, 0, 1 \
}
/* Like `CALL_USED_REGISTERS' but used to overcome a historical
problem which makes CALL_USED_REGISTERS *always* include
all the FIXED_REGISTERS. Until this problem has been
resolved this macro can be used to overcome this situation.
In particular, block_propagate() requires this list
be acurate, or we can remove registers which should be live.
This macro is used in regs_invalidated_by_call ()*/
#define CALL_REALLY_USED_REGISTERS \
{ /* General registers. */ \
1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, \
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, \
/* Floating-point registers. */ \
1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
/* Predicate registers. */ \
1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
/* Branch registers. */ \
1, 0, 0, 0, 0, 0, 1, 1, \
/*FP RA CCV UNAT PFS LC EC */ \
0, 0, 1, 1, 1, 0, 0 \
}
/* Define this macro if the target machine has register windows. This C
expression returns the register number as seen by the called function
corresponding to the register number OUT as seen by the calling function.

View File

@ -1700,6 +1700,17 @@ If a register has 0 in @code{CALL_USED_REGISTERS}, the compiler
automatically saves it on function entry and restores it on function
exit, if the register is used within the function.
@findex CALL_REALLY_USED_REGISTERS
@item CALL_REALLY_USED_REGISTERS
@cindex call-used register
@cindex call-clobbered register
@cindex call-saved register
Like @code{CALL_USED_REGISTERS} except this macro doesn't require
that the entire set of @code{FIXED_REGISTERS} be included.
(@code{CALL_USED_REGISTERS} must be a superset of @code{FIXED_REGISTERS}).
This macro is optional. If not specified, it defaults to the value
of @code{CALL_USED_REGISTERS}.
@findex HARD_REGNO_CALL_PART_CLOBBERED
@item HARD_REGNO_CALL_PART_CLOBBERED (@var{regno}, @var{mode})
@cindex call-used register

View File

@ -94,6 +94,18 @@ HARD_REG_SET losing_caller_save_reg_set;
/* Data for initializing the above. */
static char initial_call_used_regs[] = CALL_USED_REGISTERS;
/* This is much like call_used_regs, except it doesn't have to
be a superset of FIXED_REGISTERS. This vector indicates
what is really call clobbered, and is used when defining
regs_invalidated_by_call. */
char call_really_used_regs[] =
#ifdef CALL_REALLY_USED_REGISTERS
CALL_REALLY_USED_REGISTERS;
#else
CALL_USED_REGISTERS;
#endif
/* Indexed by hard register number, contains 1 for registers that are
fixed use or call used registers that cannot hold quantities across
@ -464,7 +476,7 @@ init_reg_sets_1 ()
else if (i == PIC_OFFSET_TABLE_REGNUM && flag_pic)
;
#endif
else if (call_used_regs[i] || global_regs[i])
else if (call_really_used_regs[i] || global_regs[i])
SET_HARD_REG_BIT (regs_invalidated_by_call, i);
}
@ -747,6 +759,8 @@ fix_register (name, fixed, call_used)
{
fixed_regs[i] = fixed;
call_used_regs[i] = call_used;
if (fixed == 0)
call_really_used_regs[i] = call_used;
}
}
else