This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, aarch64] Fix 70048
- From: James Greenhalgh <james dot greenhalgh at arm dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 17 Mar 2016 12:33:48 +0000
- Subject: Re: [PATCH, aarch64] Fix 70048
- Authentication-results: sourceware.org; auth=none
- References: <56E9CF47 dot 5040806 at redhat dot com>
On Wed, Mar 16, 2016 at 02:25:27PM -0700, Richard Henderson wrote:
> PR target/70048
> * config/aarch64/aarch64.c (virt_or_elim_regno_p): New.
> (aarch64_classify_address): Use it.
> (aarch64_legitimize_address): Force all subexpressions of PLUS
> into registers. Simplify as (sfp+const)+reg or (reg+reg)+const.
>
>
> diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
> index cf1239d..12e498d 100644
> --- a/gcc/config/aarch64/aarch64.c
> +++ b/gcc/config/aarch64/aarch64.c
> @@ -3847,6 +3847,18 @@ aarch64_mode_valid_for_sched_fusion_p (machine_mode mode)
> && GET_MODE_SIZE (mode) == 8);
> }
>
> +/* Return true if REGNO is a virtual pointer register, or an eliminable
> + "soft" frame register. Like REGNO_PTR_FRAME_P except that we don't
> + include stack_pointer or hard_frame_pointer. */
In that case, do we want to write this as:
return REGNO_PTR_FRAME_P (regno)
&& regno != STACK_POINTER_REGNUM
&& regno != HARD_FRAME_POINTER_REGNUM;
for clarity?
> +static bool
> +virt_or_elim_regno_p (unsigned regno)
Most functions in here get the "aarch64" in their name even if they are
static.
> +{
> + return ((regno >= FIRST_VIRTUAL_REGISTER
> + && regno <= LAST_VIRTUAL_POINTER_REGISTER)
> + || regno == FRAME_POINTER_REGNUM
> + || regno == ARG_POINTER_REGNUM);
> +}
Otherwise, this looks OK to me. Thanks for the fix.
James