aboutsummaryrefslogtreecommitdiff
path: root/gcc/caller-save.c
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>1992-08-31 08:05:07 -0600
committerJeff Law <law@gcc.gnu.org>1992-08-31 08:05:07 -0600
commitd8ed9afb2c0725bd011e9fac08ae0a2862fd5e0a (patch)
tree2b9fde5d5ffe10508f9008633b0e85396032af72 /gcc/caller-save.c
parent812dd8a30d0b036bffca9780cfdef45d934d8558 (diff)
downloadgcc-d8ed9afb2c0725bd011e9fac08ae0a2862fd5e0a.zip
gcc-d8ed9afb2c0725bd011e9fac08ae0a2862fd5e0a.tar.gz
gcc-d8ed9afb2c0725bd011e9fac08ae0a2862fd5e0a.tar.bz2
caller-save.c (restore_referenced_regs): When restoring a referenced hard register...
* 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. From-SVN: r2003
Diffstat (limited to 'gcc/caller-save.c')
-rw-r--r--gcc/caller-save.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/caller-save.c b/gcc/caller-save.c
index c0ebb27..ed4c781 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