diff mbox series

Fix rs6000 exception handling (PR target/90418)

Message ID CAGWvnynz=Did3yDAjznScwr544ryM3v5nO7eMByvqtZdz8CXYQ@mail.gmail.com
State New
Headers show
Series Fix rs6000 exception handling (PR target/90418) | expand

Commit Message

David Edelsohn May 13, 2019, 3:16 p.m. UTC
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.
diff mbox series


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));