aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-03-21 17:15:32 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1994-03-21 17:15:32 -0500
commite3a771613feb915111421ff10f29937aee88c452 (patch)
tree9db21cf638d2bc7718fc44129058eb0f8d47b459 /gcc
parent987c71d9bcf5f1211dfde6e515d8a35675ca5983 (diff)
downloadgcc-e3a771613feb915111421ff10f29937aee88c452.zip
gcc-e3a771613feb915111421ff10f29937aee88c452.tar.gz
gcc-e3a771613feb915111421ff10f29937aee88c452.tar.bz2
(preserve_temp_slots): If argument is REG, see if it is address of a
temp slot we know about. From-SVN: r6843
Diffstat (limited to 'gcc')
-rw-r--r--gcc/function.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gcc/function.c b/gcc/function.c
index a266ead..8726afb 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -946,9 +946,23 @@ preserve_temp_slots (x)
{
struct temp_slot *p;
+ if (x == 0)
+ return;
+
+ /* If X is a register that is being used as a pointer, see if we have
+ a temporary slot we know it points to. To be consistent with
+ the code below, we really should preserve all non-kept slots
+ if we can't find a match, but that seems to be much too costly. */
+ if (GET_CODE (x) == REG && REGNO_POINTER_FLAG (REGNO (x))
+ && (p = find_temp_slot_from_address (x)) != 0)
+ {
+ p->level--;
+ return;
+ }
+
/* If X is not in memory or is at a constant address, it cannot be in
a temporary slot. */
- if (x == 0 || GET_CODE (x) != MEM || CONSTANT_P (XEXP (x, 0)))
+ if (GET_CODE (x) != MEM || CONSTANT_P (XEXP (x, 0)))
return;
/* First see if we can find a match. */