]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
h8300.c (F): Add "in_epilogue" flag.
authorDJ Delorie <dj@redhat.com>
Wed, 20 Jan 2010 05:58:59 +0000 (00:58 -0500)
committerDJ Delorie <dj@gcc.gnu.org>
Wed, 20 Jan 2010 05:58:59 +0000 (00:58 -0500)
* config/h8300/h8300.c (F): Add "in_epilogue" flag.
(Fpa): Pass it
(h8300_emit_stack_adjustment): Propogate it.
(push): Pass it.
(h8300_expand_prologue): Likewise.
(h8300_expand_epilogue): Likewise.

From-SVN: r156056

gcc/ChangeLog
gcc/config/h8300/h8300.c

index ca67d10d031c65194d058a4992e51c80cc2a3b2e..82f70614a2c781549ca885744d0fecd2cdb5f621 100644 (file)
@@ -1,3 +1,12 @@
+2010-01-20  DJ Delorie  <dj@redhat.com>
+
+       * config/h8300/h8300.c (F): Add "in_epilogue" flag.
+       (Fpa): Pass it
+       (h8300_emit_stack_adjustment): Propogate it.
+       (push): Pass it.
+       (h8300_expand_prologue): Likewise.
+       (h8300_expand_epilogue): Likewise.
+
 2010-01-19  Michael Matz  <matz@suse.de>
 
        PR tree-optimization/41783
index 7bb1e7a6c5c6ed33f91413267a8baf3dedb7ea7e..e9e2216c270b3ad8d789904d6722b5bd8196a0a1 100644 (file)
@@ -83,7 +83,7 @@ static int h8300_interrupt_function_p (tree);
 static int h8300_saveall_function_p (tree);
 static int h8300_monitor_function_p (tree);
 static int h8300_os_task_function_p (tree);
-static void h8300_emit_stack_adjustment (int, HOST_WIDE_INT);
+static void h8300_emit_stack_adjustment (int, HOST_WIDE_INT, bool);
 static HOST_WIDE_INT round_frame_size (HOST_WIDE_INT);
 static unsigned int compute_saved_regs (void);
 static void push (int);
@@ -509,9 +509,10 @@ byte_reg (rtx x, int b)
 
 /* We use this to wrap all emitted insns in the prologue.  */
 static rtx
-F (rtx x)
+F (rtx x, bool set_it)
 {
-  RTX_FRAME_RELATED_P (x) = 1;
+  if (set_it)
+    RTX_FRAME_RELATED_P (x) = 1;
   return x;
 }
 
@@ -528,7 +529,7 @@ Fpa (rtx par)
   int i;
 
   for (i = 0; i < len; i++)
-    F (XVECEXP (par, 0, i));
+    F (XVECEXP (par, 0, i), true);
 
   return par;
 }
@@ -537,7 +538,7 @@ Fpa (rtx par)
    SIZE to adjust the stack pointer.  */
 
 static void
-h8300_emit_stack_adjustment (int sign, HOST_WIDE_INT size)
+h8300_emit_stack_adjustment (int sign, HOST_WIDE_INT size, bool in_prologue)
 {
   /* If the frame size is 0, we don't have anything to do.  */
   if (size == 0)
@@ -552,9 +553,9 @@ h8300_emit_stack_adjustment (int sign, HOST_WIDE_INT size)
       && !(cfun->static_chain_decl != NULL && sign < 0))
     {
       rtx r3 = gen_rtx_REG (Pmode, 3);
-      F (emit_insn (gen_movhi (r3, GEN_INT (sign * size))));
+      F (emit_insn (gen_movhi (r3, GEN_INT (sign * size))), in_prologue);
       F (emit_insn (gen_addhi3 (stack_pointer_rtx,
-                               stack_pointer_rtx, r3)));
+                               stack_pointer_rtx, r3)), in_prologue);
     }
   else
     {
@@ -568,11 +569,11 @@ h8300_emit_stack_adjustment (int sign, HOST_WIDE_INT size)
          rtx x = emit_insn (gen_addhi3 (stack_pointer_rtx,
                                         stack_pointer_rtx, GEN_INT (sign * size)));
          if (size < 4)
-           F (x);
+           F (x, in_prologue);
        }
       else
        F (emit_insn (gen_addsi3 (stack_pointer_rtx,
-                                 stack_pointer_rtx, GEN_INT (sign * size))));
+                                 stack_pointer_rtx, GEN_INT (sign * size))), in_prologue);
     }
 }
 
@@ -622,7 +623,7 @@ push (int rn)
     x = gen_push_h8300hs_advanced (reg);
   else
     x = gen_push_h8300hs_normal (reg);
-  x = F (emit_insn (x));
+  x = F (emit_insn (x), 1);
   REG_NOTES (x) = gen_rtx_EXPR_LIST (REG_INC, stack_pointer_rtx, 0);
 }
 
@@ -854,7 +855,7 @@ h8300_expand_prologue (void)
     {
       /* Push fp.  */
       push (HARD_FRAME_POINTER_REGNUM);
-      F (emit_move_insn (hard_frame_pointer_rtx, stack_pointer_rtx));
+      F (emit_move_insn (hard_frame_pointer_rtx, stack_pointer_rtx), 1);
     }
 
   /* Push the rest of the registers in ascending order.  */
@@ -885,7 +886,7 @@ h8300_expand_prologue (void)
     }
 
   /* Leave room for locals.  */
-  h8300_emit_stack_adjustment (-1, round_frame_size (get_frame_size ()));
+  h8300_emit_stack_adjustment (-1, round_frame_size (get_frame_size ()), true);
 }
 
 /* Return nonzero if we can use "rts" for the function currently being
@@ -920,7 +921,7 @@ h8300_expand_epilogue (void)
   returned_p = false;
 
   /* Deallocate locals.  */
-  h8300_emit_stack_adjustment (1, frame_size);
+  h8300_emit_stack_adjustment (1, frame_size, false);
 
   /* Pop the saved registers in descending order.  */
   saved_regs = compute_saved_regs ();