Fix bug building libgcc:
authorNick Clifton <nickc@cygnus.com>
Mon, 24 Apr 2000 18:48:41 +0000 (18:48 +0000)
committerNick Clifton <nickc@gcc.gnu.org>
Mon, 24 Apr 2000 18:48:41 +0000 (18:48 +0000)
Do not generate small add insn if the source register is eliminable.

From-SVN: r33387

gcc/ChangeLog
gcc/config/fr30/fr30.md

index 7dd344a3e95480a392f8782edd8e93d56285f194..a8443a85be1daccad077c1ee05ee581120ea90c9 100644 (file)
@@ -1,3 +1,10 @@
+2000-04-24  Nick Clifton  <nickc@cygnus.com>
+
+       * config/fr30/fr30.md (addsi3): Do not use small add instruction if
+       the source register is the frame pointer or arg pointer.
+       (addsi3_small_int): Disallow if source register is the frame
+       pointer or arg pointer.
+
 2000-04-24  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * configure.in (ENUM_BITFIELDS_ARE_UNSIGNED): Delete redundant
index afa2e2f2927fa2e1f377e4fd90d7b3b7a5c90a9d..1b8d310d838d1def3f7d42ef209356e431054800 100644 (file)
     emit_insn (gen_addsi_regs (operands[0], operands[1], operands[2]));
   else if (GET_CODE (operands[2]) != CONST_INT)
     emit_insn (gen_addsi_big_int (operands[0], operands[1], operands[2]));
-  else if ((INTVAL (operands[2]) >= -16) && (INTVAL (operands[2]) <= 15))
+  else if (   (REGNO (operands[1]) != FRAME_POINTER_REGNUM)
+           && (REGNO (operands[1]) != ARG_POINTER_REGNUM)
+          && (INTVAL (operands[2]) >= -16)
+          && (INTVAL (operands[2]) <= 15))
     emit_insn (gen_addsi_small_int (operands[0], operands[1], operands[2]));
   else
     emit_insn (gen_addsi_big_int (operands[0], operands[1], operands[2]));
   "addn        %2, %0"
 )
 
+;; Do not allow an eliminable register in the source register.  It
+;; might be eliminated in favour of the stack pointer, probably
+;; increasing the offset, and so rendering the instruction illegal.
 (define_insn "addsi_small_int"
   [(set (match_operand:SI 0 "register_operand"              "=r,r")
        (plus:SI (match_operand:SI 1 "register_operand"      "0,0")
                 (match_operand:SI 2 "add_immediate_operand" "I,J")))]
-  ""
+  "   (REGNO (operands[1]) != FRAME_POINTER_REGNUM)
+   && (REGNO (operands[1]) != ARG_POINTER_REGNUM)"
   "@
    addn        %2, %0
    addn2       %2, %0"