aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/caller-save.c9
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1a5e9c61fa5..44199272ad5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2000-08-09 Alexandre Oliva <aoliva@redhat.com>
+
+ * caller-save.c (mark_referenced_regs): Mark partially-overwritten
+ multi-word registers.
+
2000-08-08 Joseph S. Myers <jsm28@cam.ac.uk>
* c-common.c (combine_strings, check_format_info): Refer to ISO C
diff --git a/gcc/caller-save.c b/gcc/caller-save.c
index f939de77858..8a411e17c78 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)