summaryrefslogtreecommitdiff
path: root/gcc/reload.c
diff options
context:
space:
mode:
authoruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>2006-05-26 20:21:53 +0000
committeruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>2006-05-26 20:21:53 +0000
commit91e1886d605bd0e2f9c6565aa6f298f7a4cde206 (patch)
tree4aeaea82a057fcb7aa1fa27177beff021d57bea8 /gcc/reload.c
parent0f9af572e6a7748ef677f1489f48505e358a2080 (diff)
downloadgcc-91e1886d605bd0e2f9c6565aa6f298f7a4cde206.tar.gz
PR rtl-optimization/27661
* reload.c (find_reloads): When reloading a VOIDmode constant as address due to an EXTRA_MEMORY_CONSTRAINT or 'o' constraint, use Pmode as mode of the reload register. PR rtl-optimization/27661 * gcc.dg/pr27661.c: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114141 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/reload.c')
-rw-r--r--gcc/reload.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/reload.c b/gcc/reload.c
index 03b5ba6beef..feaec60433c 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -3854,11 +3854,19 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known,
&& goal_alternative_offmemok[i]
&& MEM_P (recog_data.operand[i]))
{
+ /* If the address to be reloaded is a VOIDmode constant,
+ use Pmode as mode of the reload register, as would have
+ been done by find_reloads_address. */
+ enum machine_mode address_mode;
+ address_mode = GET_MODE (XEXP (recog_data.operand[i], 0));
+ if (address_mode == VOIDmode)
+ address_mode = Pmode;
+
operand_reloadnum[i]
= push_reload (XEXP (recog_data.operand[i], 0), NULL_RTX,
&XEXP (recog_data.operand[i], 0), (rtx*) 0,
base_reg_class (VOIDmode, MEM, SCRATCH),
- GET_MODE (XEXP (recog_data.operand[i], 0)),
+ address_mode,
VOIDmode, 0, 0, i, RELOAD_FOR_INPUT);
rld[operand_reloadnum[i]].inc
= GET_MODE_SIZE (GET_MODE (recog_data.operand[i]));