This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 2/4] prologue and epilogue tidy and -mno-vrsave bug fix
- From: David Edelsohn <dje dot gcc at gmail dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, Alan Modra <amodra at gmail dot com>
- Date: Tue, 19 May 2015 10:33:16 -0400
- Subject: Re: [PATCH 2/4] prologue and epilogue tidy and -mno-vrsave bug fix
- Authentication-results: sourceware.org; auth=none
- References: <20150518025234 dot GT6140 at bubble dot grove dot modra dot org> <20150518025434 dot GV6140 at bubble dot grove dot modra dot org>
On Sun, May 17, 2015 at 10:54 PM, Alan Modra <amodra@gmail.com> wrote:
> This patch tidies the prologue and epilogue altivec code a little.
> A number of places using info->altivec_size unnecessarily also test
> TARGET_ALTIVEC_ABI, when rs6000_stack_info() guarantees that
> info->altivec_size is zero if !TARGET_ALTIVEC_ABI.
>
> Similarly by inspection of rs6000_stack_info() code,
> TARGET_ALTIVEC_VRSAVE && info->vrsave_mask != 0, used when deciding to
> save or restore vrsave, can be replaced with info->vrsave_size. I
> also removed the TARGET_ALTIVEC test used with save/restore of vrsave.
> I believe it is redundant because compute_vrsave_mask() will return 0
> when no altivec registers are used (and of course you can't use then
> without TARGET_ALTIVEC), except for Darwin where TARGET_ALTIVEC is
> forced. The vrsave changes make the code actually doing the save or
> restore visually consistent with code that sets up a frame register
> for vrsave.
>
> Finally, I've changed two places that use info->vrsave_mask to test
> whether vrsave is saved or restored, to use info->vrsave_size. This
> is a bug fix for -mno-vrsave.
>
> * 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.
This patch is okay.
My only concern is Patch 1 causing a regression for the PR that I mentioned.
Thanks, David