From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22334 invoked by alias); 19 Jul 2013 09:16:13 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 22324 invoked by uid 89); 19 Jul 2013 09:16:13 -0000 X-Spam-SWARE-Status: No, score=-3.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,RDNS_NONE,SPF_PASS autolearn=ham version=3.3.1 Received: from Unknown (HELO mail-vb0-f53.google.com) (209.85.212.53) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 19 Jul 2013 09:16:12 +0000 Received: by mail-vb0-f53.google.com with SMTP id p12so2976829vbe.40 for ; Fri, 19 Jul 2013 02:16:04 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.52.92.142 with SMTP id cm14mr4562665vdb.115.1374225364759; Fri, 19 Jul 2013 02:16:04 -0700 (PDT) Received: by 10.52.97.68 with HTTP; Fri, 19 Jul 2013 02:16:04 -0700 (PDT) In-Reply-To: <51CB6D86.9020304@arm.com> References: <51CB6AAE.8030101@arm.com> <51CB6D86.9020304@arm.com> Date: Fri, 19 Jul 2013 09:17:00 -0000 Message-ID: Subject: Re: [Patch, AArch64, ILP32] 3/5 Minor change in function.c:assign_parm_find_data_types() From: Marcus Shawcroft To: Yufeng Zhang Cc: "gcc-patches@gcc.gnu.org" , Marcus Shawcroft Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2013-07/txt/msg00762.txt.bz2 On 26 June 2013 23:39, Yufeng Zhang wrote: > This patch updates assign_parm_find_data_types to assign passed_mode and > nominal_mode with the mode of the built pointer type instead of the > hard-coded Pmode in the case of pass-by-reference. This is in line with the > assignment to passed_mode and nominal_mode in other cases inside the > function. > > assign_parm_find_data_types generally uses TYPE_MODE to calculate > passed_mode and nominal_mode: > > /* Find mode of arg as it is passed, and mode of arg as it should be > during execution of this function. */ > passed_mode = TYPE_MODE (passed_type); > nominal_mode = TYPE_MODE (nominal_type); > > this includes the case when the passed argument is a pointer by itself. > > However there is a discrepancy when it deals with argument passed by > invisible reference; it builds the argument's corresponding pointer type, > but sets passed_mode and nominal_mode with Pmode directly. > > This is OK for targets where Pmode == ptr_mode, but on AArch64 with ILP32 > they are different with Pmode as DImode and ptr_mode as SImode. When such a > reference is passed on stack, the reference is prepared by the caller in the > lower 4 bytes of an 8-byte slot but is fetched by the callee as an 8-byte > datum, of which the higher 4 bytes may contain junk. It is probably the > combination of Pmode != ptr_mode and the particular ABI specification that > make the AArch64 ILP32 the first target on which the issue manifests itself. > > Bootstrapped on x86_64-none-linux-gnu. > > OK for the trunk? Yufeng, this change makes sense to me, however I can't approve such a change. /Marcus