summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2000-08-09 05:17:12 +0000
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2000-08-09 05:17:12 +0000
commit9d19a10dc6993069e41fa3facdd68b914c30f6f7 (patch)
tree2da01318328791fb33a611fc5a9c1b622ecc3487
parent6c5605c22ee7fc8f23ac6ec0b5bc842e55258a0d (diff)
downloadppe42-gcc-9d19a10dc6993069e41fa3facdd68b914c30f6f7.tar.gz
ppe42-gcc-9d19a10dc6993069e41fa3facdd68b914c30f6f7.zip
* caller-save.c (mark_referenced_regs): Mark partially-overwritten
multi-word registers. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35579 138bc75d-0d04-0410-961f-82ee72b054a4
-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)
OpenPOWER on IntegriCloud