diff options
author | Jakub Jelinek <jakub@redhat.com> | 2002-01-16 20:01:31 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2002-01-16 20:01:31 +0100 |
commit | 51c561e360e9712070fd00eae33fe6e398d2e1fa (patch) | |
tree | 05ef909315d82a879a012d00b6ef1433f2dad614 /gcc/config/alpha | |
parent | b8c1a6b8175da581b6d613e579f94948e2ca6394 (diff) | |
download | gcc-51c561e360e9712070fd00eae33fe6e398d2e1fa.tar.gz |
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
Diffstat (limited to 'gcc/config/alpha')
-rw-r--r-- | gcc/config/alpha/alpha.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index c409fbb868c..8204c782cdf 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -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); } |