diff mbox

[ARM] Fix thinko in arm_expand_epilogue_apcs_frame

Message ID 12392081.SxxEUJaIjS@polaris
State New
Headers show

Commit Message

Eric Botcazou Dec. 18, 2013, 3:15 p.m. UTC
While arm_expand_epilogue has the correct:

  if (crtl->calls_eh_return)
    emit_insn (gen_addsi3 (stack_pointer_rtx,
                           stack_pointer_rtx,
                           gen_rtx_REG (SImode, ARM_EH_STACKADJ_REGNUM)));

arm_expand_epilogue_apcs_frame has the bogus:

   if (crtl->calls_eh_return)
     emit_insn (gen_addsi3 (stack_pointer_rtx,
               stack_pointer_rtx,
               GEN_INT (ARM_EH_STACKADJ_REGNUM)));

leading to:

  add     sp, sp, #2

in the assembly file.

Tested on ARM/VxWorks, applied on the mainline and 4.8 branch as obvious.


2013-12-18  Eric Botcazou  <ebotcazou@adacore.com>

	* config/arm/arm.c (arm_expand_epilogue_apcs_frame): Fix thinko.
diff mbox

Patch

Index: config/arm/arm.c
===================================================================
--- config/arm/arm.c	(revision 206039)
+++ config/arm/arm.c	(working copy)
@@ -26852,8 +26852,8 @@  arm_expand_epilogue_apcs_frame (bool rea
 
   if (crtl->calls_eh_return)
     emit_insn (gen_addsi3 (stack_pointer_rtx,
-               stack_pointer_rtx,
-               GEN_INT (ARM_EH_STACKADJ_REGNUM)));
+			   stack_pointer_rtx,
+			   gen_rtx_REG (SImode, ARM_EH_STACKADJ_REGNUM)));
 
   if (IS_STACKALIGN (func_type))
     /* Restore the original stack pointer.  Before prologue, the stack was