From patchwork Fri Jan 17 08:22:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael-Doyle Hudson X-Patchwork-Id: 23298 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E8DA3202FA for ; Fri, 17 Jan 2014 08:22:42 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id kq14sf8638958pab.5 for ; Fri, 17 Jan 2014 00:22:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mailing-list:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:sender :delivered-to:from:to:cc:subject:user-agent:date:message-id :mime-version:x-original-sender:x-original-authentication-results :content-type; bh=A1fIu4QiQ0ETHtIxaHZ6O4Klp7UcPguI7t23S/TEkss=; b=N2qFIdHK5WY4Wx6Q3x0yjfRdJyUN/qe6/t5lRFvqczxA1xhZEqAcEXx9ueUGwGm2Po bopr9EzY2CpS+fmZKxfhM0W9LcQ6A/Hc+LDUcmGL1BQfG5RsDX39Gq7CyOkVDO+sY6WA WpTv3Nda0SmYD4UHs62FEAowuV4wxThsRzLqAlpKVo4Zk8feY1HijxUGw5SPMjWlwGCp lf3hC8rqKTwfZwjfWVL3+6wCaQByybwubgvzoosKdIPhGUmL3KplWKzwP3XNR6BU896T 01y4pmJbYgTY5G/y46JZki9DmRcdRFnaj0CyiAJVbRwXRW8His18kederhxnsEa0qt+K ErCA== X-Gm-Message-State: ALoCoQn2yeBflUXjAuNARIJ8zffDVKP7gteb6P4UsbhNxeWFDJJEUnq8fw/VAMAQEcOT2G6cDwOb X-Received: by 10.66.250.200 with SMTP id ze8mr195026pac.29.1389946962152; Fri, 17 Jan 2014 00:22:42 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.61.163 with SMTP id q3ls745008qer.99.gmail; Fri, 17 Jan 2014 00:22:41 -0800 (PST) X-Received: by 10.229.219.5 with SMTP id hs5mr950673qcb.9.1389946961944; Fri, 17 Jan 2014 00:22:41 -0800 (PST) Received: from mail-vb0-x22f.google.com (mail-vb0-x22f.google.com [2607:f8b0:400c:c02::22f]) by mx.google.com with ESMTPS id c108si1508649qgf.172.2014.01.17.00.22.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Jan 2014 00:22:41 -0800 (PST) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::22f is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::22f; Received: by mail-vb0-f47.google.com with SMTP id p6so1402372vbe.20 for ; Fri, 17 Jan 2014 00:22:41 -0800 (PST) X-Received: by 10.220.178.73 with SMTP id bl9mr58608vcb.42.1389946961736; Fri, 17 Jan 2014 00:22:41 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.59.13.131 with SMTP id ey3csp2781ved; Fri, 17 Jan 2014 00:22:40 -0800 (PST) X-Received: by 10.68.184.194 with SMTP id ew2mr719092pbc.100.1389946960377; Fri, 17 Jan 2014 00:22:40 -0800 (PST) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id vz4si9452996pac.238.2014.01.17.00.22.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Jan 2014 00:22:40 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-359812-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 7654 invoked by alias); 17 Jan 2014 08:22:27 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list 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 7637 invoked by uid 89); 17 Jan 2014 08:22:27 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: youngberry.canonical.com Received: from youngberry.canonical.com (HELO youngberry.canonical.com) (91.189.89.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 17 Jan 2014 08:22:26 +0000 Received: from 121-73-77-183.cable.telstraclear.net ([121.73.77.183] helo=narsil) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1W44h5-0002s3-2Z; Fri, 17 Jan 2014 08:22:23 +0000 Received: by narsil (Postfix, from userid 1000) id 56722526725; Fri, 17 Jan 2014 21:22:18 +1300 (NZDT) From: Michael Hudson-Doyle To: gcc-patches Cc: Marcus Shawcroft , Richard Earnshaw , Ian Lance Taylor Subject: Allow passing arrays in registers on AArch64 User-Agent: Notmuch/0.17~rc1+4~g7f07bfd (http://notmuchmail.org) Emacs/24.3.50.2 (x86_64-pc-linux-gnu) Date: Fri, 17 Jan 2014 21:22:18 +1300 Message-ID: <87ha93nhl1.fsf@canonical.com> MIME-Version: 1.0 X-Original-Sender: michael.hudson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::22f is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@gcc.gnu.org X-Google-Group-Id: 836684582541 Hi, as discussed in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59799 GCC currently gets a detail of the AArch64 ABI wrong: arrays are not always passed by reference. Fortunately the fix is rather easy... I guess this is an ABI break but my understand there has been no release of GCC which supports compiling a language that can pass arrays by value on AArch64 yet. Cheers, mwh 2014-01-17 Michael Hudson-Doyle PR target/59799 * config/aarch64/aarch64.c (aarch64_pass_by_reference): The rules for passing arrays in registers are the same as for structs, so remove the special case for them. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index fa53c71..d63da95 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -987,10 +987,7 @@ aarch64_pass_by_reference (cumulative_args_t pcum ATTRIBUTE_UNUSED, if (type) { - /* Arrays always passed by reference. */ - if (TREE_CODE (type) == ARRAY_TYPE) - return true; - /* Other aggregates based on their size. */ + /* Aggregates based on their size. */ if (AGGREGATE_TYPE_P (type)) size = int_size_in_bytes (type); }