rs6000: Fix shrink-wrap-separate for AIX
All out-of-line register save routines need LR, so we cannot wrap the LR component if there are out-of-line saves. This didn't show up for testing on Linux because none of the tests there use out-of-line FPR saves without also using out-of-line GPR saves, which we did handle. This patch fixes it, and also cleans up code a little. * config/rs6000/rs6000.c (rs6000_get_separate_components): Do not make LR a separately shrink-wrapped component unless savres_strategy contains all of {SAVE,REST}_INLINE_{GPRS,FPRS,VRS}. Do not wrap GPRs unless both {SAVE,REST}_INLINE_GPRS. Do not disallow all wrapping when not both {SAVE,REST}_INLINE_GPRS. From-SVN: r241203
This commit is contained in:
parent
baa33d8380
commit
f9e9d32f79
|
@ -1,3 +1,11 @@
|
||||||
|
2016-10-15 Segher Boessenkool <segher@kernel.crashing.org>
|
||||||
|
|
||||||
|
* config/rs6000/rs6000.c (rs6000_get_separate_components): Do not
|
||||||
|
make LR a separately shrink-wrapped component unless savres_strategy
|
||||||
|
contains all of {SAVE,REST}_INLINE_{GPRS,FPRS,VRS}. Do not wrap
|
||||||
|
GPRs unless both {SAVE,REST}_INLINE_GPRS. Do not disallow all
|
||||||
|
wrapping when not both {SAVE,REST}_INLINE_GPRS.
|
||||||
|
|
||||||
2016-10-15 Eric Botcazou <ebotcazou@adacore.com>
|
2016-10-15 Eric Botcazou <ebotcazou@adacore.com>
|
||||||
|
|
||||||
* optabs.c (expand_parity): Fix mode mismatch, add final conversion
|
* optabs.c (expand_parity): Fix mode mismatch, add final conversion
|
||||||
|
|
|
@ -27439,27 +27439,29 @@ rs6000_get_separate_components (void)
|
||||||
{
|
{
|
||||||
rs6000_stack_t *info = rs6000_stack_info ();
|
rs6000_stack_t *info = rs6000_stack_info ();
|
||||||
|
|
||||||
if (!(info->savres_strategy & SAVE_INLINE_GPRS)
|
if (WORLD_SAVE_P (info))
|
||||||
|| !(info->savres_strategy & REST_INLINE_GPRS)
|
|
||||||
|| WORLD_SAVE_P (info))
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
sbitmap components = sbitmap_alloc (32);
|
sbitmap components = sbitmap_alloc (32);
|
||||||
bitmap_clear (components);
|
bitmap_clear (components);
|
||||||
|
|
||||||
/* The GPRs we need saved to the frame. */
|
/* The GPRs we need saved to the frame. */
|
||||||
int reg_size = TARGET_32BIT ? 4 : 8;
|
if ((info->savres_strategy & SAVE_INLINE_GPRS)
|
||||||
int offset = info->gp_save_offset;
|
&& (info->savres_strategy & REST_INLINE_GPRS))
|
||||||
if (info->push_p)
|
|
||||||
offset += info->total_size;
|
|
||||||
|
|
||||||
for (unsigned regno = info->first_gp_reg_save; regno < 32; regno++)
|
|
||||||
{
|
{
|
||||||
if (IN_RANGE (offset, -0x8000, 0x7fff)
|
int reg_size = TARGET_32BIT ? 4 : 8;
|
||||||
&& rs6000_reg_live_or_pic_offset_p (regno))
|
int offset = info->gp_save_offset;
|
||||||
bitmap_set_bit (components, regno);
|
if (info->push_p)
|
||||||
|
offset += info->total_size;
|
||||||
|
|
||||||
offset += reg_size;
|
for (unsigned regno = info->first_gp_reg_save; regno < 32; regno++)
|
||||||
|
{
|
||||||
|
if (IN_RANGE (offset, -0x8000, 0x7fff)
|
||||||
|
&& rs6000_reg_live_or_pic_offset_p (regno))
|
||||||
|
bitmap_set_bit (components, regno);
|
||||||
|
|
||||||
|
offset += reg_size;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Don't mess with the hard frame pointer. */
|
/* Don't mess with the hard frame pointer. */
|
||||||
|
@ -27472,11 +27474,18 @@ rs6000_get_separate_components (void)
|
||||||
|| (flag_pic && DEFAULT_ABI == ABI_DARWIN))
|
|| (flag_pic && DEFAULT_ABI == ABI_DARWIN))
|
||||||
bitmap_clear_bit (components, RS6000_PIC_OFFSET_TABLE_REGNUM);
|
bitmap_clear_bit (components, RS6000_PIC_OFFSET_TABLE_REGNUM);
|
||||||
|
|
||||||
/* Optimize LR save and restore if we can. This is component 0. */
|
/* Optimize LR save and restore if we can. This is component 0. Any
|
||||||
|
out-of-line register save/restore routines need LR. */
|
||||||
if (info->lr_save_p
|
if (info->lr_save_p
|
||||||
&& !(flag_pic && (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_DARWIN)))
|
&& !(flag_pic && (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_DARWIN))
|
||||||
|
&& (info->savres_strategy & SAVE_INLINE_GPRS)
|
||||||
|
&& (info->savres_strategy & REST_INLINE_GPRS)
|
||||||
|
&& (info->savres_strategy & SAVE_INLINE_FPRS)
|
||||||
|
&& (info->savres_strategy & REST_INLINE_FPRS)
|
||||||
|
&& (info->savres_strategy & SAVE_INLINE_VRS)
|
||||||
|
&& (info->savres_strategy & REST_INLINE_VRS))
|
||||||
{
|
{
|
||||||
offset = info->lr_save_offset;
|
int offset = info->lr_save_offset;
|
||||||
if (info->push_p)
|
if (info->push_p)
|
||||||
offset += info->total_size;
|
offset += info->total_size;
|
||||||
if (IN_RANGE (offset, -0x8000, 0x7fff))
|
if (IN_RANGE (offset, -0x8000, 0x7fff))
|
||||||
|
|
Loading…
Reference in New Issue