diff options
author | Segher Boessenkool <segher@kernel.crashing.org> | 2016-10-18 10:00:00 +0200 |
---|---|---|
committer | Segher Boessenkool <segher@gcc.gnu.org> | 2016-10-18 10:00:00 +0200 |
commit | 8f784f6bde1ff14f73bc8337e5f250209a6831d8 (patch) | |
tree | 2c28aa3372658183b6f063cf897d857331cb97ef | |
parent | 62869a1ca1ddb89e9cb5c808bfe678979e4090f0 (diff) | |
download | gcc-8f784f6bde1ff14f73bc8337e5f250209a6831d8.zip gcc-8f784f6bde1ff14f73bc8337e5f250209a6831d8.tar.gz gcc-8f784f6bde1ff14f73bc8337e5f250209a6831d8.tar.bz2 |
rs6000: Fix separate shrink-wrapping for TARGET_MULTIPLE
We cannot use {SAVE,REST}_MULTIPLE and separate shrink-wrapping together,
not without checking when actually emitting the prologue/epilogue that the
registers to save/restore are actually still one contiguous block up to
(and including) 31. So either:
1) We delay the decision of whether to use lmw/stmw to later;
2) We disallow shrink-wrapping separate (integer) components when those
strategies are selected; or
3) We don't use those strategies if we use separate shrink-wrapping.
This patch does 3). In the long term it may be best to do 1) instead,
it can be slightly more efficient.
This caused problems on darwin (it is the only config that uses lmw/stmw
instructions by default).
* config/rs6000/rs6000.c (rs6000_savres_strategy): Do not select
{SAVE,REST}_MULTIPLE if shrink-wrapping separate components.
(rs6000_get_separate_components): Assert we do not have those
strategies selected.
From-SVN: r241297
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 8 |
2 files changed, 14 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 77fef06..9e98664 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-10-18 Segher Boessenkool <segher@kernel.crashing.org> + + * config/rs6000/rs6000.c (rs6000_savres_strategy): Do not select + {SAVE,REST}_MULTIPLE if shrink-wrapping separate components. + (rs6000_get_separate_components): Assert we do not have those + strategies selected. + 2016-10-18 Richard Biener <rguenther@suse.de> * tree-ssa-propagate.h (substitute_and_fold): Adjust prototype. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 2761187..2406d5c 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -25518,7 +25518,10 @@ rs6000_savres_strategy (rs6000_stack_t *info, if (TARGET_MULTIPLE && !TARGET_POWERPC64 && !(TARGET_SPE_ABI && info->spe_64bit_regs_used) - && info->first_gp_reg_save < 31) + && info->first_gp_reg_save < 31 + && !(flag_shrink_wrap + && flag_shrink_wrap_separate + && optimize_function_for_speed_p (cfun))) { /* Prefer store multiple for saves over out-of-line routines, since the store-multiple instruction will always be smaller. */ @@ -27452,6 +27455,9 @@ rs6000_get_separate_components (void) sbitmap components = sbitmap_alloc (32); bitmap_clear (components); + gcc_assert (!(info->savres_strategy & SAVE_MULTIPLE) + && !(info->savres_strategy & REST_MULTIPLE)); + /* The GPRs we need saved to the frame. */ if ((info->savres_strategy & SAVE_INLINE_GPRS) && (info->savres_strategy & REST_INLINE_GPRS)) |