From a3d59ce91088e9ea56ccbeab3f607d555f5b66e6 Mon Sep 17 00:00:00 2001 From: Segher Boessenkool Date: Tue, 14 May 2019 19:33:10 +0200 Subject: [PATCH] rs6000: New enum epilogue_type We currently call rs6000_emit_epilogue with a boolean parameter saying if this is for a sibcall. We also need to create epilogues for eh_return. This isn't yet indicated directly: instead, we get an eh_return epilogue if crtl->calls_eh_return and this is not a sibcall. This patch changes things so there is a three-way enum argument. What is called "normal" now can still actually be "eh_return". The rs6000_emit_epilogue function still uses an "int sibcall" variable internally. * config/rs6000/rs6000-protos.h (rs6000_emit_epilogue): Change arguments. * config/rs6000/rs6000.c (rs6000_emit_epilogue): Change arguments. * config/rs6000/rs6000.md (epilogue_type): New define_enum. (sibcall_epilogue): Adjust. (epilogue): Adjust. From-SVN: r271184 --- gcc/ChangeLog | 9 +++++++++ gcc/config/rs6000/rs6000-protos.h | 2 +- gcc/config/rs6000/rs6000.c | 3 ++- gcc/config/rs6000/rs6000.md | 6 ++++-- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bb597fa519e..812f8c34399 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2019-05-14 Segher Boessenkool + + * config/rs6000/rs6000-protos.h (rs6000_emit_epilogue): Change + arguments. + * config/rs6000/rs6000.c (rs6000_emit_epilogue): Change arguments. + * config/rs6000/rs6000.md (epilogue_type): New define_enum. + (sibcall_epilogue): Adjust. + (epilogue): Adjust. + 2019-05-14 Rainer Orth * config.gcc: Move *-*-solaris2.10* from obsolete configurations diff --git a/gcc/config/rs6000/rs6000-protos.h b/gcc/config/rs6000/rs6000-protos.h index 8466368ce4b..9718adaa2b9 100644 --- a/gcc/config/rs6000/rs6000-protos.h +++ b/gcc/config/rs6000/rs6000-protos.h @@ -190,7 +190,7 @@ extern alias_set_type get_TOC_alias_set (void); extern void rs6000_emit_prologue (void); extern void rs6000_emit_load_toc_table (int); extern unsigned int rs6000_dbx_register_number (unsigned int, unsigned int); -extern void rs6000_emit_epilogue (int); +extern void rs6000_emit_epilogue (enum epilogue_type); extern void rs6000_expand_split_stack_prologue (void); extern void rs6000_split_stack_space_check (rtx, rtx); extern void rs6000_emit_eh_reg_restore (rtx, rtx); diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index b886f585404..2992ba545d7 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -27874,8 +27874,9 @@ emit_cfa_restores (rtx cfa_restores) /* Emit function epilogue as insns. */ void -rs6000_emit_epilogue (int sibcall) +rs6000_emit_epilogue (enum epilogue_type epilogue_type) { + int sibcall = (epilogue_type == EPILOGUE_TYPE_SIBCALL); rs6000_stack_t *info; int restoring_GPRs_inline; int restoring_FPRs_inline; diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 8da7aba4080..c3181e7f4dc 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -174,6 +174,8 @@ UNSPECV_SPEC_BARRIER ; Speculation barrier ]) +; The three different kinds of epilogue. +(define_enum "epilogue_type" [normal sibcall eh_return]) ;; Define an insn type attribute. This is used in function unit delay ;; computations. @@ -10941,7 +10943,7 @@ { if (!TARGET_SCHED_PROLOG) emit_insn (gen_blockage ()); - rs6000_emit_epilogue (TRUE); + rs6000_emit_epilogue (EPILOGUE_TYPE_SIBCALL); DONE; }) @@ -12881,7 +12883,7 @@ { if (!TARGET_SCHED_PROLOG) emit_insn (gen_blockage ()); - rs6000_emit_epilogue (FALSE); + rs6000_emit_epilogue (EPILOGUE_TYPE_NORMAL); DONE; }) -- 2.30.2