From 2696f6a43d6cb8810564ed9d7d38518676608fb5 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Wed, 9 Aug 2000 05:17:12 +0000 Subject: caller-save.c (mark_referenced_regs): Mark partially-overwritten multi-word registers. * caller-save.c (mark_referenced_regs): Mark partially-overwritten multi-word registers. From-SVN: r35579 --- gcc/caller-save.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'gcc/caller-save.c') diff --git a/gcc/caller-save.c b/gcc/caller-save.c index f939de7..8a411e1 100644 --- a/gcc/caller-save.c +++ b/gcc/caller-save.c @@ -512,7 +512,14 @@ mark_referenced_regs (x) x = SET_DEST (x); code = GET_CODE (x); if (code == REG || code == PC || code == CC0 - || (code == SUBREG && GET_CODE (SUBREG_REG (x)) == REG)) + || (code == SUBREG && GET_CODE (SUBREG_REG (x)) == REG + /* If we're setting only part of a multi-word register, + we shall mark it as referenced, because the words + that are not being set should be restored. */ + && ((GET_MODE_SIZE (GET_MODE (x)) + >= GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)))) + || (GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))) + <= UNITS_PER_WORD)))) return; } if (code == MEM || code == SUBREG) -- cgit v1.1