diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-02-02 16:52:21 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-02-02 16:52:21 +0000 |
commit | 8e4f36faa04d35ac315b959ccd4494db8e27bc93 (patch) | |
tree | 58fc51ec9cdef4e637114018446c740238f15bf1 /gcc/reload.c | |
parent | 46c50a880c28656c502aaf8703d7f8a84bad9c1c (diff) | |
download | gcc-8e4f36faa04d35ac315b959ccd4494db8e27bc93.tar.gz |
PR middle-end/47543
* reload.c (find_reloads_address): Handle reg+d address where both
components are invalid by reloading the entire address.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@169533 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/reload.c')
-rw-r--r-- | gcc/reload.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/reload.c b/gcc/reload.c index aa9e68e59b6..714355c3201 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -5066,8 +5066,13 @@ find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad, && REG_P (XEXP (ad, 0)) && REGNO (XEXP (ad, 0)) < FIRST_PSEUDO_REGISTER && CONST_INT_P (XEXP (ad, 1)) - && regno_ok_for_base_p (REGNO (XEXP (ad, 0)), mode, PLUS, - CONST_INT)) + && (regno_ok_for_base_p (REGNO (XEXP (ad, 0)), mode, PLUS, + CONST_INT) + /* Similarly, if we were to reload the base register and the + mem+offset address is still invalid, then we want to reload + the whole address, not just the base register. */ + || ! maybe_memory_address_addr_space_p + (mode, ad, as, &(XEXP (ad, 0))))) { /* Unshare the MEM rtx so we can safely alter it. */ @@ -5079,7 +5084,9 @@ find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad, loc = &XEXP (*loc, 0); } - if (double_reg_address_ok) + if (double_reg_address_ok + && regno_ok_for_base_p (REGNO (XEXP (ad, 0)), mode, + PLUS, CONST_INT)) { /* Unshare the sum as well. */ *loc = ad = copy_rtx (ad); |