diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1992-08-31 14:05:07 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1992-08-31 14:05:07 +0000 |
commit | 3e02c34b84a68c3c5b21b4d2cc87df9598be1480 (patch) | |
tree | 2b9fde5d5ffe10508f9008633b0e85396032af72 | |
parent | 79947bbaf647fb7f812143d01482c058386f3afe (diff) | |
download | gcc-3e02c34b84a68c3c5b21b4d2cc87df9598be1480.tar.gz |
* caller-save.c (restore_referenced_regs): When restoring a
referenced hard register, use CEIL instead of truncating
divide to determine the maximum number of registers to
restore.
(insert_save_restore): Document maxrestore parameter.
(CEIL): Define.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@2003 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/caller-save.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/caller-save.c b/gcc/caller-save.c index c0ebb27154e..ed4c7819336 100644 --- a/gcc/caller-save.c +++ b/gcc/caller-save.c @@ -28,6 +28,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "reload.h" #include "expr.h" +#define CEIL(x,y) (((x) + (y) - 1) / (y)) + /* Modes for each hard register that we can save. The smallest mode is wide enough to save the entire contents of the register. When saving the register because it is live we first try to save in multi-register modes. @@ -593,7 +595,7 @@ restore_referenced_regs (x, insn, insn_mode) for (i = regno; i < endregno; i++) if (TEST_HARD_REG_BIT (hard_regs_need_restore, i)) i += insert_save_restore (insn, 0, i, insn_mode, - GET_MODE_SIZE (GET_MODE (x)) / UNITS_PER_WORD); + CEIL (GET_MODE_SIZE (GET_MODE (x)), UNITS_PER_WORD)); } return; @@ -612,7 +614,9 @@ restore_referenced_regs (x, insn, insn_mode) /* Insert a sequence of insns to save or restore, SAVE_P says which, REGNO. Place these insns in front of INSN. INSN_MODE is the mode - to assign to these insns. + to assign to these insns. MAXRESTORE is the maximum number of registers + which should be restored during this call (when SAVE_P == 0). It should + never be less than 1 since we only work with entire registers. Note that we have verified in init_caller_save that we can do this with a simple SET, so use it. Set INSN_CODE to what we save there |