From: Alan Lawrence <alan.lawrence@foss.arm.com>
To: gcc-patches@gcc.gnu.org
Cc: James Greenhalgh <james.greenhalgh@arm.com>,
Marcus Shawcroft <Marcus.Shawcroft@arm.com>,
Richard Earnshaw <Richard.Earnshaw@arm.com>
Subject: Re: [PATCH 1/2][AArch64] Implement AAPCS64 updates for alignment attribute
Date: Fri, 11 Mar 2016 10:18:00 -0000 [thread overview]
Message-ID: <56E29B7D.6020705@foss.arm.com> (raw)
In-Reply-To: <56D9C4DD.9070807@foss.arm.com>
On 04/03/16 17:24, Alan Lawrence wrote:
> On 26/02/16 14:52, James Greenhalgh wrote:
>
>>>> 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;
>>>> }
>>>>
>>>
>>>
>>> Ping.
[snip]
>
> I'm not proposing to backport these AArch64 changes, hence:
>
> Ping^2.
>
> (For gcc 7 ?)
>
> Also tests https://gcc.gnu.org/ml/gcc-patches/2016-01/msg01073.html .
Ping^3.
Cheers, Alan
next prev parent reply other threads:[~2016-03-11 10:18 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 [this message]
2016-06-07 11:07 ` James Greenhalgh
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=56E29B7D.6020705@foss.arm.com \
--to=alan.lawrence@foss.arm.com \
--cc=Marcus.Shawcroft@arm.com \
--cc=Richard.Earnshaw@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=james.greenhalgh@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).