From: Paul Brook Date: Wed, 27 Sep 2006 17:09:40 +0000 (+0000) Subject: re PR target/29230 (gcc-4.1 generates faulty asm on ARM when compiling openmsx 0... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bcf640f76d83f5dcf813b5fca8075291872985eb;p=gcc.git re PR target/29230 (gcc-4.1 generates faulty asm on ARM when compiling openmsx 0.6.1 with -O3) 2006-09-27 Paul Brook PR target/29230 gcc/ * config/arm/arm.md (arith_adjacentmem): Handle large offsets. From-SVN: r117253 --- 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) {