reload.c (find_reloads): Set operand_mode to Pmode for address operands consisting of just a CONST_INT.

2011-09-22  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* reload.c (find_reloads): Set operand_mode to Pmode for address
	operands consisting of just a CONST_INT.

From-SVN: r179099
This commit is contained in:
Andreas Krebbel 2011-09-22 18:54:34 +00:00 committed by Andreas Krebbel
parent 22deafa844
commit 1907712374
3 changed files with 82 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2011-09-22 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* reload.c (find_reloads): Set operand_mode to Pmode for address
operands consisting of just a CONST_INT.
2011-09-22 Uros Bizjak <ubizjak@gmail.com>
PR target/50482

View File

@ -2825,6 +2825,13 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known,
/* Address operands are reloaded in their existing mode,
no matter what is specified in the machine description. */
operand_mode[i] = GET_MODE (recog_data.operand[i]);
/* If the address is a single CONST_INT pick address mode
instead otherwise we will later not know in which mode
the reload should be performed. */
if (operand_mode[i] == VOIDmode)
operand_mode[i] = Pmode;
}
else if (code == MEM)
{

View File

@ -0,0 +1,70 @@
/* { dg-compile } */
/* { dg-options "-O2" } */
static inline unsigned long
lay_uw(unsigned long addr)
{
unsigned long result;
__asm__ ("lay %[result],%a[addr]"
: [result] "=d" (result)
: [addr] "UW" (addr));
return result;
}
static inline unsigned long
la_u(unsigned long addr)
{
unsigned long result;
__asm__ ("la %[result],%a[addr]"
: [result] "=d" (result)
: [addr] "U" (addr));
return result;
}
static inline unsigned long
lay_zqzrzszt(unsigned long addr)
{
unsigned long result;
__asm__ ("lay %[result],%a[addr]"
: [result] "=d" (result)
: [addr] "ZQZRZSZT" (addr));
return result;
}
static inline unsigned long
la_zqzr(unsigned long addr)
{
unsigned long result;
__asm__ ("la %[result],%a[addr]"
: [result] "=d" (result)
: [addr] "ZQZR" (addr));
return result;
}
extern unsigned long a[15];
int main(void)
{
a[1] = lay_uw(3333);
a[2] = lay_uw(4444);
a[3] = lay_uw(1000000);
a[4] = lay_uw(a[0]);
a[5] = la_u(2222);
a[6] = la_u(5555);
a[7] = la_u(a[0]);
a[8] = lay_zqzrzszt(3333);
a[9] = lay_zqzrzszt(4444);
a[10] = lay_zqzrzszt(1000000);
a[11] = lay_zqzrzszt(a[0]);
a[12] = la_zqzr(2222);
a[13] = la_zqzr(5555);
a[14] = la_zqzr(a[0]);
}