OSDN Git Service

PR target/33388
authorrask <rask@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Sep 2007 13:24:44 +0000 (13:24 +0000)
committerrask <rask@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Sep 2007 13:24:44 +0000 (13:24 +0000)
PR target/33397
* config/fr30/fr30.md (addsi3): Check REG_P() before calling REGNO().
(addsi_small_int): Likewise.
(addsi_big_int): Use rtx_equal_p() instead of REGNO() comparison.
(one_cmplsi2): Likewise.
(negsi2): Delete.
(enter_func): Expand insn using hard_frame_pointer_rtx and
stack_pointer_rtx.
(*enter_func): New.
* config/fr30/fr30.c (fr30_expand_prologue): Check for
hard_frame_pointer_rtx instead of using REGNO() check.
Properly sign extend GEN_INT() argument.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128577 138bc75d-0d04-0410-961f-82ee72b054a4

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

index a582c5f..5fc7710 100644 (file)
@@ -1,3 +1,19 @@
+2007-09-18  Rask Ingemann Lambertsen  <rask@sygehus.dk>
+
+       PR target/33388
+       PR target/33397
+       * config/fr30/fr30.md (addsi3): Check REG_P() before calling REGNO().
+       (addsi_small_int): Likewise.
+       (addsi_big_int): Use rtx_equal_p() instead of REGNO() comparison.
+       (one_cmplsi2): Likewise.
+       (negsi2): Delete.
+       (enter_func): Expand insn using hard_frame_pointer_rtx and
+       stack_pointer_rtx.
+       (*enter_func): New.
+       * config/fr30/fr30.c (fr30_expand_prologue): Check for
+       hard_frame_pointer_rtx instead of using REGNO() check.
+       Properly sign extend GEN_INT() argument.
+
 2007-09-18  Roman Zippel <zippel@linux-m68k.org>
 
        * config/m68k/m68k.c (override_options): Remove USE_GAS,
index 7856f87..343dd02 100644 (file)
@@ -308,7 +308,7 @@ fr30_expand_prologue (void)
                     G++ testsuite.  */
                  if (! frame_pointer_needed
                      && GET_CODE (part) == SET
-                     && REGNO (SET_DEST (part)) == HARD_FRAME_POINTER_REGNUM)
+                     && SET_DEST (part) == hard_frame_pointer_rtx)
                    RTX_FRAME_RELATED_P (part) = 0;
                  else
                    RTX_FRAME_RELATED_P (part) = 1;
@@ -336,7 +336,8 @@ fr30_expand_prologue (void)
     ; /* Nothing to do.  */
   else if (current_frame_info.frame_size <= 512)
     {
-      insn = emit_insn (gen_add_to_stack (GEN_INT (- current_frame_info.frame_size)));
+      insn = emit_insn (gen_add_to_stack
+                        (GEN_INT (- (signed) current_frame_info.frame_size)));
       RTX_FRAME_RELATED_P (insn) = 1;
     }
   else
index 8bd0c35..a198ea3 100644 (file)
     emit_insn (gen_addsi_big_int (operands[0], operands[1], operands[2]));
   else if (INTVAL (operands[2]) >= -16
           && INTVAL (operands[2]) <= 15
-          && (!REGNO_PTR_FRAME_P (REGNO (operands[1]))
+          && (!REG_P (operands[1])
+              || !REGNO_PTR_FRAME_P (REGNO (operands[1]))
               || REGNO (operands[1]) == STACK_POINTER_REGNUM))
     emit_insn (gen_addsi_small_int (operands[0], operands[1], operands[2]));
   else
   [(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_PTR_FRAME_P (REGNO (operands[1]))
+  "!REG_P (operands[1])
+   || !REGNO_PTR_FRAME_P (REGNO (operands[1]))
    || REGNO (operands[1]) == STACK_POINTER_REGNUM"
   "@
    addn        %2, %0
   ""
   "{
   /* Cope with the possibility that ops 0 and 1 are the same register.  */
-  if (REGNO (operands[0]) == REGNO (operands[1]))
+  if (rtx_equal_p (operands[0], operands[1]))
     {
       if (reload_in_progress || reload_completed)
         {
 )
 
 ;;}}}
-;;{{{ Negation 
-
-(define_expand "negsi2"
-  [(set (match_operand:SI 0 "register_operand"         "")
-       (neg:SI (match_operand:SI 1 "register_operand" "")))]
-  ""
-  "{
-  if (REGNO (operands[0]) == REGNO (operands[1]))
-    {
-      if (reload_in_progress || reload_completed)
-        {
-         rtx reg = gen_rtx_REG (SImode, 0/*COMPILER_SCRATCH_REGISTER*/);
-         
-         emit_insn (gen_movsi (reg, const0_rtx));
-         emit_insn (gen_subsi3 (reg, reg, operands[0]));
-         emit_insn (gen_movsi (operands[0], reg));
-       }
-      else
-       {
-         rtx reg = gen_reg_rtx (SImode);
-       
-         emit_insn (gen_movsi (reg, const0_rtx));
-         emit_insn (gen_subsi3 (reg, reg, operands[0]));
-         emit_insn (gen_movsi (operands[0], reg));
-       }
-    }
-  else
-    {
-      emit_insn (gen_movsi_internal (operands[0], const0_rtx));
-      emit_insn (gen_subsi3 (operands[0], operands[0], operands[1]));
-    }
-  DONE;
-  }"
-)
-
-;;}}}
-
 ;;}}} \f
 ;;{{{ Shifts 
 
        (not:SI (match_operand:SI 1 "register_operand" "")))]
   ""
   "{
-  if (REGNO (operands[0]) == REGNO (operands[1]))
+  if (rtx_equal_p (operands[0], operands[1]))
     {
       if (reload_in_progress || reload_completed)
         {
   "leave"
 )
 
-(define_insn "enter_func"
+(define_expand "enter_func"
+  [(parallel
+  [(set:SI (mem:SI (minus:SI (match_dup 1)
+                            (const_int 4)))
+          (match_dup 2))
+   (set:SI (match_dup 2)
+          (minus:SI (match_dup 1)
+                    (const_int 4)))
+   (set:SI (match_dup 1)
+          (minus:SI (match_dup 1)
+                    (match_operand:SI 0 "immediate_operand")))]
+  )]
+  ""
+{
+  operands[1] = stack_pointer_rtx;
+  operands[2] = hard_frame_pointer_rtx;
+})
+
+(define_insn "*enter_func"
   [(set:SI (mem:SI (minus:SI (reg:SI 15)
                             (const_int 4)))
           (reg:SI 14))