caller-save.c (mark_referenced_regs): Mark partially-overwritten multi-word registers.
authorAlexandre Oliva <aoliva@redhat.com>
Wed, 9 Aug 2000 05:17:12 +0000 (05:17 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Wed, 9 Aug 2000 05:17:12 +0000 (05:17 +0000)
* caller-save.c (mark_referenced_regs): Mark partially-overwritten
multi-word registers.

From-SVN: r35579

gcc/ChangeLog
gcc/caller-save.c

index 1a5e9c61fa565b3e668d49104563a4ed7cce19ee..44199272ad5362947b84f223702c40dbf8c7afe9 100644 (file)
@@ -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
index f939de778582ce42f56ead3fa7ebceb3f7a49c02..8a411e17c78b9f6ec2afa6b8bd0b491ab5032ec4 100644 (file)
@@ -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)