This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, moxie] Clean up prologue and epilogue


Richard Henderson wrote:
-      insn = emit_move_insn (stack_pointer_rtx, reg);
-      RTX_FRAME_RELATED_P (insn) = 1;
-      add_reg_note (insn, REG_CFA_DEF_CFA,
-            plus_constant (stack_pointer_rtx,
-                   cfun->machine->callee_saved_reg_size));
+      if (cfun->machine->callee_saved_reg_size <= 255)
+    {
+      emit_move_insn (reg, hard_frame_pointer_rtx);
+      emit_insn (gen_subsi3
+             (reg, reg,
+              GEN_INT (cfun->machine->callee_saved_reg_size)));
+    }
+      else
+    {
+      emit_move_insn (reg,
+              GEN_INT (-cfun->machine->callee_saved_reg_size));
+      emit_insn (gen_addsi3 (reg, reg, hard_frame_pointer_rtx));
+    }
       for (regno = FIRST_PSEUDO_REGISTER; regno-- > 0; )

You lost all the epilogue unwind notes.
I'm not adjusting the stack pointer anymore (the final "ret" instruction does that). Are they still needed?

AG






r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]