]> gcc.gnu.org Git - gcc.git/commitdiff
re PR target/29230 (gcc-4.1 generates faulty asm on ARM when compiling openmsx 0...
authorPaul Brook <paul@codesourcery.com>
Wed, 27 Sep 2006 17:09:40 +0000 (17:09 +0000)
committerPaul Brook <pbrook@gcc.gnu.org>
Wed, 27 Sep 2006 17:09:40 +0000 (17:09 +0000)
2006-09-27  Paul Brook  <paul@codesourcery.com>

PR target/29230
gcc/
* config/arm/arm.md (arith_adjacentmem): Handle large offsets.

From-SVN: r117253

gcc/ChangeLog
gcc/config/arm/arm.md

index 584f6de233987d72b592ddd3f9538d4da3d19284..856bcb254331d657cddd6b31fd7aad0a7da325af 100644 (file)
@@ -1,3 +1,8 @@
+2006-09-27  Paul Brook  <paul@codesourcery.com>
+
+       PR target/29230
+       * config/arm/arm.md (arith_adjacentmem): Handle large offsets.
+
 2006-09-27  Richard Sandiford  <richard@codesourcery.com>
 
        * reload1.c (alter_reg): Require the alignment of the stack slot to
index 9abe62c17f77c37f173ffe4d8a453aef41bba43d..b28e3d01a573f95010de5a79b3a24632efc10402 100644 (file)
     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);
            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)
       {
This page took 0.075659 seconds and 5 git commands to generate.