From cdb1295a71a64755c39d8f4e7b0354c10d16398a Mon Sep 17 00:00:00 2001 From: pbrook Date: Wed, 27 Sep 2006 17:09:40 +0000 Subject: [PATCH] 2006-09-27 Paul Brook PR target/29230 gcc/ * config/arm/arm.md (arith_adjacentmem): Handle large offsets. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117253 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/config/arm/arm.md | 17 ++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 584f6de2339..856bcb25433 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2006-09-27 Paul Brook + + PR target/29230 + * config/arm/arm.md (arith_adjacentmem): Handle large offsets. + 2006-09-27 Richard Sandiford * reload1.c (alter_reg): Require the alignment of the stack slot to diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 9abe62c17f7..b28e3d01a57 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -9508,14 +9508,14 @@ ldm[0] = base_reg; if (val1 !=0 && val2 != 0) { + rtx ops[3]; + if (val1 == 4 || val2 == 4) /* Other val must be 8, since we know they are adjacent and neither is zero. */ output_asm_insn (\"ldm%?ib\\t%0, {%1, %2}\", ldm); - else + else if (const_ok_for_arm (val1) || const_ok_for_arm (-val1)) { - rtx ops[3]; - ldm[0] = ops[0] = operands[4]; ops[1] = base_reg; ops[2] = GEN_INT (val1); @@ -9525,6 +9525,17 @@ else output_asm_insn (\"ldm%?da\\t%0, {%1, %2}\", ldm); } + else + { + /* Offset is out of range for a single add, so use two ldr. */ + ops[0] = ldm[1]; + ops[1] = base_reg; + ops[2] = GEN_INT (val1); + output_asm_insn (\"ldr%?\\t%0, [%1, %2]\", ops); + ops[0] = ldm[2]; + ops[2] = GEN_INT (val2); + output_asm_insn (\"ldr%?\\t%0, [%1, %2]\", ops); + } } else if (val1 != 0) { -- 2.11.4.GIT