From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 61866 invoked by alias); 8 Dec 2015 15:34:35 -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 61856 invoked by uid 89); 8 Dec 2015 15:34:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 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; Tue, 08 Dec 2015 15:34:33 +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 23B7349; Tue, 8 Dec 2015 07:34:10 -0800 (PST) Received: from e108033-lin.cambridge.arm.com (e108033-lin.cambridge.arm.com [10.2.206.36]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 558EE3F4FF; Tue, 8 Dec 2015 07:34:31 -0800 (PST) Subject: Re: [C] Issue an error on scalar va_list with reverse storage order To: Eric Botcazou , gcc-patches@gcc.gnu.org References: <1548495.Pq4l84u6ES@polaris> From: Matthew Wahab Message-ID: <5666F885.6060602@foss.arm.com> Date: Tue, 08 Dec 2015 15:34:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <1548495.Pq4l84u6ES@polaris> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-12/txt/msg00881.txt.bz2 Hello On 03/12/15 14:53, Eric Botcazou wrote: > further testing revealed an issue with va_arg handling and reverse scalar storage > order on some platforms: when va_list is scalar, passing a field of a structure > with reverse SSO as first argument to va_start/va_arg/va_end doesn't work because > the machinery takes its address and this is not allowed for such a field (it's > really a corner case but gcc.c-torture/execute/stdarg-2.c does exercise it). Hence > the attached patch which issues an error in this case. The new gcc.dg/sso-9.c test is failing for aarch64 and arm targets. There's no error generated if I compile the test from the command line for aarch64-none-elf. GCC for x86_64 does generate the error. Matthew > 2015-12-03 Eric Botcazou > > * c-tree.h (c_build_va_arg): Adjust prototype. * c-parser.c > (c_parser_postfix_expression): Adjust call to above. * c-typeck.c > (c_build_va_arg): Rename LOC parameter to LOC2, add LOC1 parameter, adjust > throughout and issue an error if EXPR is a component with reverse storage order. > > > 2015-12-03 Eric Botcazou > > * gcc.dg/sso-9.c: New test.