[PATCH] rs6000: Fix shrink-wrap-separate for AIX

David Edelsohn dje.gcc@gmail.com
Sun Oct 16 12:37:00 GMT 2016


On Sat, Oct 15, 2016 at 2:16 PM, Segher Boessenkool
<segher@kernel.crashing.org> wrote:
> On Sat, Oct 15, 2016 at 07:55:47AM -0400, David Edelsohn wrote:
>> Maybe rs6000 always should prefer inline save-restore when SWS is
>> enabled, except for optimize_size?
>
> Yes, that would be a good optimization probably.
>
> try_shrink_wrapping_separate already does nothing unless you have
> optimize_function_for_speed_p (cfun), so that will do what you want
> already.

Maybe something like the following:

* config/rs6000/rs6000.c (rs6000_savres_strategy) [AIX,ELFv2]: Inline
FPR save and restore if shrink-wrapping and not optimizing for size.

Index: rs6000.c
===================================================================
--- rs6000.c    (revision 241210)
+++ rs6000.c    (working copy)
@@ -25445,7 +25445,8 @@
   else
     {
       gcc_checking_assert (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2);
-      if (info->first_fp_reg_save > 61)
+      if ((!optimize_size && flag_shrink_wrap_separate)
+         || info->first_fp_reg_save > 61)
        strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS;
       strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS;
       strategy |= SAVE_INLINE_VRS | REST_INLINE_VRS;

Thanks, David



More information about the Gcc-patches mailing list