Following the same pattern as the AArch64 patch, this patch fixes the
PPC32 BE and AIX EH failures after the sibcall changes.

This does not address the Darwin failures because of SAVE_WORLD.

Bootstrapped on powerpc-ibm-aix7.2.0.0, powerpc64le-unknown-linux-gnu,
powerpc64-unknown-linux-gnu, powerpc-unknown-linux-gnu

Approved by Segher and me.

Thanks, David

* config/rs6000/rs6000.c (rs6000_emit_epilogue): Don't load EH data
registers in sibcall epilogues. Don't add EH_RETURN_STACKADJ_RTX to sp
in sibcall epilogues.

Index: rs6000.c
===================================================================
--- rs6000.c    (revision 271111)
+++ rs6000.c    (working copy)
@@ -28423,7 +28423,7 @@ rs6000_emit_epilogue (int sibcall)
     restore_saved_lr (0, exit_func);

   /* Load exception handler data registers, if needed.  */
-  if (crtl->calls_eh_return)
+  if (!sibcall && crtl->calls_eh_return)
     {
       unsigned int i, regno;

@@ -28614,7 +28614,7 @@ rs6000_emit_epilogue (int sibcall)
       RTX_FRAME_RELATED_P (insn) = 1;
     }

-  if (crtl->calls_eh_return)
+  if (!sibcall && crtl->calls_eh_return)
     {
       rtx sa = EH_RETURN_STACKADJ_RTX;
       emit_insn (gen_add3_insn (sp_reg_rtx, sp_reg_rtx, sa));

Reply via email to