public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: James Greenhalgh <james.greenhalgh@arm.com>
To: Alan Lawrence <alan.lawrence@arm.com>
Cc: <gcc-patches@gcc.gnu.org>, <Marcus.Shawcroft@arm.com>,
	<Richard.Earnshaw@arm.com>, <ebotcazou@adacore.com>,
	<charlet@adacore.com>,	<nd@arm.com>
Subject: Re: [PATCH 1/2][AArch64] Implement AAPCS64 updates for alignment attribute
Date: Tue, 07 Jun 2016 11:07:00 -0000	[thread overview]
Message-ID: <20160607110703.GA4240@arm.com> (raw)
In-Reply-To: <1453482960-2606-1-git-send-email-alan.lawrence@arm.com>

On Fri, Jan 22, 2016 at 05:16:00PM +0000, Alan Lawrence wrote:
> 
> On 21/01/16 17:23, Alan Lawrence wrote:
> > On 18/01/16 17:10, Eric Botcazou wrote:
> >>
> >> Could you post the list of files that differ?  How do they differ exactly?
> >
> > Hmmm. Well, I definitely had this failing to bootstrap once. I repeated that, to
> > try to identify exactly what the differences were....and it succeeded even with
> > my pre-AAPCS64-update host compiler. So, this is probably a false alarm; I'm
> > bootstrapping again, after a rebase, to make sure...
> >
> > --Alan
> 
> Ok, rebased onto a more recent build, and bootstrapping with Ada posed no
> problems. Sorry for the noise.
> 
> However, I had to drop the assert that TYPE_FIELDS was non-null because of some
> C++ testcases.
> 
> Is this version OK for trunk?

Now that we're in GCC7, this version of the patch is OK for trunk.

From my reading of Richard's AAPCS update, this patch implements the
rules as required.

I'll give this a day for any last minute comments from Richard/Marcus,
then commit this on your behalf tomorrow.

Thanks,
James

> gcc/ChangeLog:
> 
> 	* gcc/config/aarch64/aarch64.c (aarch64_function_arg_alignment):
> 	Rewrite, looking one level down for records and arrays.
> ---
>  gcc/config/aarch64/aarch64.c | 31 ++++++++++++++++---------------
>  1 file changed, 16 insertions(+), 15 deletions(-)
> 
> diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
> index 9142ac0..b084f83 100644
> --- a/gcc/config/aarch64/aarch64.c
> +++ b/gcc/config/aarch64/aarch64.c
> @@ -1925,22 +1925,23 @@ aarch64_vfp_is_call_candidate (cumulative_args_t pcum_v, machine_mode mode,
>  static unsigned int
>  aarch64_function_arg_alignment (machine_mode mode, const_tree type)
>  {
> -  unsigned int alignment;
> +  if (!type)
> +    return GET_MODE_ALIGNMENT (mode);
> +  if (integer_zerop (TYPE_SIZE (type)))
> +    return 0;
>  
> -  if (type)
> -    {
> -      if (!integer_zerop (TYPE_SIZE (type)))
> -	{
> -	  if (TYPE_MODE (type) == mode)
> -	    alignment = TYPE_ALIGN (type);
> -	  else
> -	    alignment = GET_MODE_ALIGNMENT (mode);
> -	}
> -      else
> -	alignment = 0;
> -    }
> -  else
> -    alignment = GET_MODE_ALIGNMENT (mode);
> +  gcc_assert (TYPE_MODE (type) == mode);
> +
> +  if (!AGGREGATE_TYPE_P (type))
> +    return TYPE_ALIGN (TYPE_MAIN_VARIANT (type));
> +
> +  if (TREE_CODE (type) == ARRAY_TYPE)
> +    return TYPE_ALIGN (TREE_TYPE (type));
> +
> +  unsigned int alignment = 0;
> +
> +  for (tree field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
> +    alignment = std::max (alignment, DECL_ALIGN (field));
>  
>    return alignment;
>  }
> -- 
> 1.9.1
> 

  parent reply	other threads:[~2016-06-07 11:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-15 14:17 [PATCH 0/2][AArch64] " Alan Lawrence
2016-01-15 14:18 ` [PATCH 1/2][AArch64] " Alan Lawrence
2016-01-15 14:18 ` [PATCH 2/2][AArch64] Tests of " Alan Lawrence
2016-06-07 11:09   ` James Greenhalgh
2016-01-18 17:11 ` [PATCH 0/2][AArch64] Implement " Eric Botcazou
2016-01-21 17:23   ` Alan Lawrence
2016-01-22 17:16     ` [PATCH 1/2][AArch64] " Alan Lawrence
2016-01-22 18:49       ` Eric Botcazou
2016-02-22 15:07       ` Alan Lawrence
2016-02-26 14:52         ` James Greenhalgh
2016-03-04 17:24           ` Alan Lawrence
2016-03-11 10:18             ` Alan Lawrence
2016-06-07 11:07       ` James Greenhalgh [this message]
2016-06-08 17:04         ` James Greenhalgh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160607110703.GA4240@arm.com \
    --to=james.greenhalgh@arm.com \
    --cc=Marcus.Shawcroft@arm.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=alan.lawrence@arm.com \
    --cc=charlet@adacore.com \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nd@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).