On Sat, May 6, 2023 at 1:41 AM Fei Gao <gao...@eswincomputing.com> wrote: > > zcmp aims to reduce code size, while shrink-wrap-separate prefers > speed to code size. So disable shrink-wrap-separate if zcmp > enabled, just like what save-restore has done. > > author: Zhangjin Liao liaozhang...@eswincomputing.com > > gcc/ChangeLog: > > * config/riscv/riscv.cc (riscv_get_separate_components): > --- > gcc/config/riscv/riscv.cc | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc > index 45a63cab9c9..629e5e45cac 100644 > --- a/gcc/config/riscv/riscv.cc > +++ b/gcc/config/riscv/riscv.cc > @@ -5729,7 +5729,8 @@ riscv_get_separate_components (void) > > if (riscv_use_save_libcall (&cfun->machine->frame) > || cfun->machine->interrupt_handler_p > - || !cfun->machine->frame.gp_sp_offset.is_constant ()) > + || !cfun->machine->frame.gp_sp_offset.is_constant () > + || TARGET_ZCMP) > return components;
I think this is a bad idea. I have a use case where we use the C extensions but still compile for -O2 because we want the code to be fast as possible but still having the savings of the C extensions. Thanks, Andrew Pinski > > offset = cfun->machine->frame.gp_sp_offset.to_constant (); > -- > 2.17.1 >