alpha.c (some_small_symbolic_mem_operand): Look into (and:DI () (const_int -8)).

* config/alpha/alpha.c (some_small_symbolic_mem_operand): Look into
	(and:DI () (const_int -8)).
	(split_small_symbolic_mem_operand): Split
	(mem (and:DI () (const_int -8)).

	* gcc.dg/20020116-1.c: New test.

From-SVN: r48920
This commit is contained in:
Jakub Jelinek 2002-01-16 20:01:31 +01:00 committed by Jakub Jelinek
parent b8c1a6b817
commit 51c561e360
4 changed files with 48 additions and 7 deletions

View File

@ -1,3 +1,10 @@
2002-01-16 Jakub Jelinek <jakub@redhat.com>
* config/alpha/alpha.c (some_small_symbolic_mem_operand): Look into
(and:DI () (const_int -8)).
(split_small_symbolic_mem_operand): Split
(mem (and:DI () (const_int -8)).
2002-01-16 Jakub Jelinek <jakub@redhat.com>
PR target/5309:

View File

@ -1878,8 +1878,16 @@ some_small_symbolic_mem_operand (x, mode)
while (GET_RTX_CLASS (GET_CODE (x)) == '1')
x = XEXP (x, 0);
return (GET_CODE (x) == MEM
&& small_symbolic_operand (XEXP (x, 0), Pmode));
if (GET_CODE (x) != MEM)
return 0;
x = XEXP (x, 0);
/* If this is an ldq_u type address, discard the outer AND. */
if (GET_CODE (x) == AND && GET_MODE (x) == DImode
&& GET_CODE (XEXP (x, 1)) == CONST_INT
&& INTVAL (XEXP (x, 1)) == -8)
x = XEXP (x, 0);
return small_symbolic_operand (x, Pmode);
}
rtx
@ -1890,7 +1898,17 @@ split_small_symbolic_mem_operand (x)
if (GET_CODE (x) == MEM)
{
rtx tmp = gen_rtx_LO_SUM (DImode, pic_offset_table_rtx, XEXP (x, 0));
rtx tmp = XEXP (x, 0);
if (GET_CODE (tmp) == AND && GET_MODE (tmp) == DImode
&& GET_CODE (XEXP (tmp, 1)) == CONST_INT
&& INTVAL (XEXP (tmp, 1)) == -8)
{
tmp = gen_rtx_LO_SUM (DImode, pic_offset_table_rtx, XEXP (tmp, 0));
tmp = gen_rtx_AND (DImode, tmp, GEN_INT (-8));
}
else
tmp = gen_rtx_LO_SUM (DImode, pic_offset_table_rtx, tmp);
return replace_equiv_address (x, tmp);
}

View File

@ -1,11 +1,11 @@
2002-01-16 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/ultrasp4.c: New test.
2002-01-16 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/20020116-2.c: New test.
* gcc.dg/ultrasp4.c: New test.
* gcc.dg/20020116-1.c: New test.
2002-01-15 Geoffrey Keating <geoffk@redhat.com>
* gcc.dg/20020103-1.c: Also test for __PPC__, since that's used

View File

@ -0,0 +1,16 @@
/* This testcase ICEd on Alpha because ldq_u argument was not subject to
small_symbolic_mem_operand splitting. */
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-options "-O2 -fpic -mexplicit-relocs -mcpu=ev4" { target alpha*-*-* } } */
static char a;
char *b;
void foo (void)
{
register char *c;
c = b;
*c = a;
}