aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>1997-04-24 03:09:29 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>1997-04-24 03:09:29 +0000
commit9e148ceb90467f15aedd11194a071489810e9c0f (patch)
treee1a6406128b0a09ca4a34d5333fbb96c0ecaa1f2 /gcc
parent173cd503de58534f6192be7efb0a43ba1450a0f1 (diff)
downloadgcc-9e148ceb90467f15aedd11194a071489810e9c0f.zip
gcc-9e148ceb90467f15aedd11194a071489810e9c0f.tar.gz
gcc-9e148ceb90467f15aedd11194a071489810e9c0f.tar.bz2
Use push_operand to check for changes to the stack pointer
From-SVN: r13975
Diffstat (limited to 'gcc')
-rw-r--r--gcc/reload1.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 61b8d01..2054edf 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -7600,7 +7600,7 @@ reload_cse_invalidate_regno (regno, mode, clobber)
for (x = reg_values[i]; x; x = XEXP (x, 1))
{
if (XEXP (x, 0) != 0
- && refers_to_regno_p (regno, endregno, XEXP (x, 0), NULL_RTX))
+ && refers_to_regno_p (regno, endregno, XEXP (x, 0), NULL_PTR))
{
/* If this is the only entry on the list, clear
reg_values[i]. Otherwise, just clear this entry on
@@ -8186,7 +8186,7 @@ reload_cse_record_set (set, body)
rtx set;
rtx body;
{
- rtx dest, src;
+ rtx dest, src, x;
int dreg, sreg;
enum machine_mode dest_mode;
@@ -8196,6 +8196,23 @@ reload_cse_record_set (set, body)
sreg = true_regnum (src);
dest_mode = GET_MODE (dest);
+ /* Some machines don't define AUTO_INC_DEC, but they still use push
+ instructions. We need to catch that case here in order to
+ invalidate the stack pointer correctly. Note that invalidating
+ the stack pointer is different from invalidating DEST. */
+ x = dest;
+ while (GET_CODE (x) == SUBREG
+ || GET_CODE (x) == ZERO_EXTRACT
+ || GET_CODE (x) == SIGN_EXTRACT
+ || GET_CODE (x) == STRICT_LOW_PART)
+ x = XEXP (x, 0);
+ if (push_operand (x, GET_MODE (x)))
+ {
+ reload_cse_invalidate_rtx (stack_pointer_rtx, NULL_RTX);
+ reload_cse_invalidate_rtx (dest, NULL_RTX);
+ return;
+ }
+
/* We can only handle an assignment to a register, or a store of a
register to a memory location. For other cases, we just clobber
the destination. We also have to just clobber if there are side