From fc1296b77aae81ca5df45cd699c23e80b6e5e1fd Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Wed, 1 Aug 2001 21:40:43 +0000 Subject: [PATCH] regclass.c (call_really_used_regs): New array for registers which are actually used by a call. 2001-08-01 Andrew MacLeod * 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 --- gcc/ChangeLog | 10 ++++++++++ gcc/config/ia64/ia64.h | 39 +++++++++++++++++++++++++++++++++++++++ gcc/doc/tm.texi | 11 +++++++++++ gcc/regclass.c | 16 +++++++++++++++- 4 files changed, 75 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 75a65020c61..6639e941456 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2001-08-01 Andrew MacLeod + + * 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 * read-rtl.c (read_name): Consider \r whitespace. diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h index 5bb79e8634e..0df4ceb8b18 100644 --- a/gcc/config/ia64/ia64.h +++ b/gcc/config/ia64/ia64.h @@ -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 ()*/ +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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. diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index ee621aeebfa..34bea569d92 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -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 diff --git a/gcc/regclass.c b/gcc/regclass.c index b16a677d805..9d1fe55b4b5 100644 --- a/gcc/regclass.c +++ b/gcc/regclass.c @@ -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 -- 2.30.2