diff options
author | Richard Sandiford <richard@codesourcery.com> | 2006-09-13 06:30:59 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2006-09-13 06:30:59 +0000 |
commit | 4b7b277aff44cffe643cff9b84d13968b29fa177 (patch) | |
tree | 2aa34947dc3602c792429dc6db53537ff293ce74 /gcc/reload1.c | |
parent | 04df96dded18551448d76b9a753c83d917a8cebd (diff) | |
download | gcc-4b7b277aff44cffe643cff9b84d13968b29fa177.zip gcc-4b7b277aff44cffe643cff9b84d13968b29fa177.tar.gz gcc-4b7b277aff44cffe643cff9b84d13968b29fa177.tar.bz2 |
re PR rtl-optimization/28982 (Incorrect reloading of automodification expressions)
gcc/
PR rtl-optimization/28982
* reload.c (find_reloads_address_1): Use RELOAD_OTHER for the
index of a PRE_MODIFY or POST_MODIFY address.
* reload1.c (inc_for_reload): Use find_replacement on the original
base and index registers.
gcc/testsuite/
PR rtl-optimization/28982
* gcc.c-torture/execute/pr28982a.c: New test.
* gcc.c-torture/execute/pr28982b.c: Likewise.
From-SVN: r116919
Diffstat (limited to 'gcc/reload1.c')
-rw-r--r-- | gcc/reload1.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c index 8dd0018..04f6448 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -8177,7 +8177,7 @@ static rtx inc_for_reload (rtx reloadreg, rtx in, rtx value, int inc_amount) { /* REG or MEM to be copied and incremented. */ - rtx incloc = XEXP (value, 0); + rtx incloc = find_replacement (&XEXP (value, 0)); /* Nonzero if increment after copying. */ int post = (GET_CODE (value) == POST_DEC || GET_CODE (value) == POST_INC || GET_CODE (value) == POST_MODIFY); @@ -8186,7 +8186,7 @@ inc_for_reload (rtx reloadreg, rtx in, rtx value, int inc_amount) rtx add_insn; int code; rtx store; - rtx real_in = in == value ? XEXP (in, 0) : in; + rtx real_in = in == value ? incloc : in; /* No hard register is equivalent to this register after inc/dec operation. If REG_LAST_RELOAD_REG were nonzero, @@ -8198,7 +8198,7 @@ inc_for_reload (rtx reloadreg, rtx in, rtx value, int inc_amount) if (GET_CODE (value) == PRE_MODIFY || GET_CODE (value) == POST_MODIFY) { gcc_assert (GET_CODE (XEXP (value, 1)) == PLUS); - inc = XEXP (XEXP (value, 1), 1); + inc = find_replacement (&XEXP (XEXP (value, 1), 1)); } else { |