From patchwork Fri Jan 22 17:16:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Lawrence X-Patchwork-Id: 571753 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2F22A1402D9 for ; Sat, 23 Jan 2016 04:16:24 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=nhbcdYb6; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=l7498U2kx1KfJzE3KwM8wNZuPZH0IBCvUVgy3TyzHYhRyOnFtjEre hKV0UgDQpxcNU8MoEz7YlWT6+4CRAS5r17tLXu412aHPOKNk8nbc5yA+4HTMTB60 Y44+gxy+PykKOGgHJovwHQgDl3YTXj1D/0+ly2O/eKEWfJONxPBDQA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; s= default; bh=3HX9+r/3977JuxinKV36wOenL2M=; b=nhbcdYb6kDh+dlqf4vXE kYpNPsFeXU4rPNzWIXJOOj1zv9DtH/x41nRiZXbsiXoj9ZUl6AeuowrQS0cTFlZw 9OH6vmzIk1XjoCibPdqmtK+H+7LHQf+CPz532CBS8lPkDl0lF5kQQQO4Gskk/5lN B22xYvuzR5Twtd9KAZzcUZM= Received: (qmail 56154 invoked by alias); 22 Jan 2016 17:16:14 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 56134 invoked by uid 89); 22 Jan 2016 17:16:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2195, repeated, alarm, sk:pre-aap X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 22 Jan 2016 17:16:13 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D2C3249; Fri, 22 Jan 2016 09:15:31 -0800 (PST) Received: from arm.com (e105915-lin.emea.arm.com [10.2.206.30]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 26F7B3F529; Fri, 22 Jan 2016 09:16:10 -0800 (PST) From: Alan Lawrence To: gcc-patches@gcc.gnu.org Cc: Marcus.Shawcroft@arm.com, Richard.Earnshaw@arm.com, James.Greenhalgh@arm.com, ebotcazou@adacore.com, charlet@adacore.com Subject: Re: [PATCH 1/2][AArch64] Implement AAPCS64 updates for alignment attribute Date: Fri, 22 Jan 2016 17:16:00 +0000 Message-Id: <1453482960-2606-1-git-send-email-alan.lawrence@arm.com> In-Reply-To: <56A113F7.1000503@foss.arm.com> References: <56A113F7.1000503@foss.arm.com> X-IsSubscribed: yes 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? --Alan 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; }