From 8a03f86937467dcfe401b4f369307faf2593e97a Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 20 May 2015 10:47:45 +0930 Subject: [PATCH] rs6000.c (struct rs6000_stack): Correct comments. * config/rs6000/rs6000.c (struct rs6000_stack): Correct comments. (rs6000_stack_info): Don't zero offsets when not saving registers. (debug_stack_info): Adjust to omit printing unused offsets, as before. (direct_return): Test vrsave_size rather than vrsave_mask. (rs6000_emit_prologue): Likewise. Remove redundant altivec tests. (rs6000_emit_epilogue): Likewise. From-SVN: r223425 --- gcc/ChangeLog | 10 ++++++++++ gcc/config/rs6000/rs6000.c | 31 +++++++++++-------------------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5fa48fa7d33..56b028d7c53 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2015-05-20 Alan Modra + + * config/rs6000/rs6000.c (struct rs6000_stack): Correct comments. + (rs6000_stack_info): Don't zero offsets when not saving registers. + (debug_stack_info): Adjust to omit printing unused offsets, + as before. + (direct_return): Test vrsave_size rather than vrsave_mask. + (rs6000_emit_prologue): Likewise. Remove redundant altivec tests. + (rs6000_emit_epilogue): Likewise. + 2015-05-20 Alan Modra * config/rs6000/rs6000.c (rs6000_stack_info): Don't zero offsets diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 488799efd63..92ebd82fadc 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -155,10 +155,9 @@ typedef struct rs6000_stack { int gp_size; /* size of saved GP registers */ int fp_size; /* size of saved FP registers */ int altivec_size; /* size of saved AltiVec registers */ - int cr_size; /* size to hold CR if not in save_size */ - int vrsave_size; /* size to hold VRSAVE if not in save_size */ - int altivec_padding_size; /* size of altivec alignment padding if - not in save_size */ + int cr_size; /* size to hold CR if not in fixed area */ + int vrsave_size; /* size to hold VRSAVE */ + int altivec_padding_size; /* size of altivec alignment padding */ int spe_gp_size; /* size of 64-bit GPR save size for SPE */ int spe_padding_size; HOST_WIDE_INT total_size; /* total bytes allocated for stack */ @@ -5206,7 +5205,7 @@ direct_return (void) && info->first_altivec_reg_save == LAST_ALTIVEC_REGNO + 1 && ! info->lr_save_p && ! info->cr_save_p - && info->vrsave_mask == 0 + && info->vrsave_size == 0 && ! info->push_p) return 1; } @@ -23636,7 +23635,7 @@ rs6000_emit_prologue (void) || info->first_fp_reg_save < 64 || info->first_gp_reg_save < 32 || info->altivec_size != 0 - || info->vrsave_mask != 0 + || info->vrsave_size != 0 || crtl->calls_eh_return) ptr_regno = 12; else @@ -24184,7 +24183,7 @@ rs6000_emit_prologue (void) /* Save AltiVec registers if needed. Save here because the red zone does not always include AltiVec registers. */ - if (!WORLD_SAVE_P (info) && TARGET_ALTIVEC_ABI + if (!WORLD_SAVE_P (info) && info->altivec_size != 0 && (strategy & SAVE_INLINE_VRS) == 0) { int end_save = info->altivec_save_offset + info->altivec_size; @@ -24220,7 +24219,7 @@ rs6000_emit_prologue (void) frame_off = ptr_off; } } - else if (!WORLD_SAVE_P (info) && TARGET_ALTIVEC_ABI + else if (!WORLD_SAVE_P (info) && info->altivec_size != 0) { int i; @@ -24262,9 +24261,7 @@ rs6000_emit_prologue (void) epilogue. */ if (!WORLD_SAVE_P (info) - && TARGET_ALTIVEC - && TARGET_ALTIVEC_VRSAVE - && info->vrsave_mask != 0) + && info->vrsave_size != 0) { rtx reg, vrsave; int offset; @@ -24826,8 +24823,7 @@ rs6000_emit_epilogue (int sibcall) /* Restore AltiVec registers if we must do so before adjusting the stack. */ - if (TARGET_ALTIVEC_ABI - && info->altivec_size != 0 + if (info->altivec_size != 0 && (ALWAYS_RESTORE_ALTIVEC_BEFORE_POP || (DEFAULT_ABI != ABI_V4 && offset_below_red_zone_p (info->altivec_save_offset)))) @@ -24914,9 +24910,7 @@ rs6000_emit_epilogue (int sibcall) } /* Restore VRSAVE if we must do so before adjusting the stack. */ - if (TARGET_ALTIVEC - && TARGET_ALTIVEC_VRSAVE - && info->vrsave_mask != 0 + if (info->vrsave_size != 0 && (ALWAYS_RESTORE_ALTIVEC_BEFORE_POP || (DEFAULT_ABI != ABI_V4 && offset_below_red_zone_p (info->vrsave_save_offset)))) @@ -25010,7 +25004,6 @@ rs6000_emit_epilogue (int sibcall) /* Restore AltiVec registers if we have not done so already. */ if (!ALWAYS_RESTORE_ALTIVEC_BEFORE_POP - && TARGET_ALTIVEC_ABI && info->altivec_size != 0 && (DEFAULT_ABI == ABI_V4 || !offset_below_red_zone_p (info->altivec_save_offset))) @@ -25118,9 +25111,7 @@ rs6000_emit_epilogue (int sibcall) /* Restore VRSAVE if we have not done so already. */ if (!ALWAYS_RESTORE_ALTIVEC_BEFORE_POP - && TARGET_ALTIVEC - && TARGET_ALTIVEC_VRSAVE - && info->vrsave_mask != 0 + && info->vrsave_size != 0 && (DEFAULT_ABI == ABI_V4 || !offset_below_red_zone_p (info->vrsave_save_offset))) { -- 2.30.2