From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 64C4B3858C5F for ; Fri, 1 Mar 2024 14:00:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 64C4B3858C5F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 64C4B3858C5F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709301661; cv=none; b=wCLbwMC1g1+N5HCviiFn2KKJvqEPxnqn9gjpK2AcP05Dabq+lWrs1W9T71MJuqFpXt1xJ/Ujgeg6CJEkX4GCWAfZBccWw16gaUZGWPo40iZw4Z707zaI6MwqKxN2NYrj+daurzfuNu8MhRRqU8gjNF7QYmpacLB2hW7QteqFnAY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709301661; c=relaxed/simple; bh=JZJ5nxmfUpbF6gwLZWXC0QylPl7FPl00vkXbSjRdwd0=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=oN8/1l0GAdPLbwgT9DbhGuKQbO9QW0sDGpNyvKZZwHZZbs/Jf2JVfPb/rmRHHVT0GbWqy18uTMBA1nwDZl7It5YRIlZ3To2M4KEnfttkdscRhHG1jEFiS0U+RF8AEEhdqeA9tuyVxIFrR8ZNdTKqXDrnPEBfiM/mf1CUbydqLho= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709301659; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=h5OUYn91w0Cew+SJT/tyfjY5KEZyZ6X5fp7rQNZCK9c=; b=EbzfjENgqYFJ2DWfebfCYmWiYF8jdviLvxGIWxo+DZFk5okkikyuHRBfx6OxoouH4f/HA0 0uDABNfaRmO7Jno2PcFL1GtcGqspu2Rs5e9ZXMMhf4SrP4xZYnwCKP8qvK5HhxZQ5o9Oe+ BlDxSM24C8n5Ns8Jta7Y5V2LvDcaW/U= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-416-1wl3XfXjOfOt_vh6bOIxxg-1; Fri, 01 Mar 2024 09:00:55 -0500 X-MC-Unique: 1wl3XfXjOfOt_vh6bOIxxg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 302208B31CF; Fri, 1 Mar 2024 14:00:55 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.45.226.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D83B68CED; Fri, 1 Mar 2024 14:00:54 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 421E0q0w687997 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 1 Mar 2024 15:00:52 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 421E0pCr687995; Fri, 1 Mar 2024 15:00:51 +0100 Date: Fri, 1 Mar 2024 15:00:51 +0100 From: Jakub Jelinek To: "Richard Earnshaw (lists)" Cc: "Joseph S. Myers" , Richard Biener , Jeff Law , gcc-patches@gcc.gnu.org, =?iso-8859-1?Q?Torbj=F6rn?= SVENSSON , oliva@adacore.com Subject: Re: [PATCH] calls: Further fixes for TYPE_NO_NAMED_ARGS_STDARG_P handling [PR107453] Message-ID: Reply-To: Jakub Jelinek References: <45ac2d54-21df-486c-a085-0a6c1f37a323@arm.com> <23c7c873-1954-43b2-80b8-714455eaaf2b@arm.com> <9b4f43f8-3807-432f-b1a2-e0515ab198ca@arm.com> <028f7bd5-838b-4add-a226-d4ec1c436c0b@arm.com> MIME-Version: 1.0 In-Reply-To: <028f7bd5-838b-4add-a226-d4ec1c436c0b@arm.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, Mar 01, 2024 at 01:53:08PM +0000, Richard Earnshaw (lists) wrote: > On 29/02/2024 17:56, Jakub Jelinek wrote: > > On Thu, Feb 29, 2024 at 05:51:03PM +0000, Richard Earnshaw (lists) wrote: > >> Oh, but wait! Perhaps that now falls into the initial 'if' clause and we never reach the point where you pick zero. So perhaps I'm worrying about nothing. > > > > If you are worried about the > > + else if (TYPE_NO_NAMED_ARGS_STDARG_P (funtype) > > + && ! targetm.calls.pretend_outgoing_varargs_named (args_so_far)) > > n_named_args = 0; > > case in the patch, we know at that point that the initial n_named_args is > > equal to structure_value_addr_parm, so either 0, in that case > > --n_named_args; > > would yield the undesirable negative value, so we want 0 instead; for that > > case we could as well just have ; in there instead of n_named_args = 0;, > > or it is 1, in that case --n_named_args; would turn that into 0. > > > > Jakub > > > > No, I was thinking about the case of strict_argument_naming when the first argument is the artificial return value pointer. In that case we'd want n_named_args=1. > > But I think it's a non-issue as that will be caught by > > if ((type_arg_types != 0 || TYPE_NO_NAMED_ARGS_STDARG_P (funtype)) > && targetm.calls.strict_argument_naming (args_so_far)) > ; Yes, that for strict argument naming and calls to struct large_struct foo (...); with the patch we set n_named_args = 1 early: else if (TYPE_NO_NAMED_ARGS_STDARG_P (funtype)) n_named_args = structure_value_addr_parm; and then if ((type_arg_types != 0 || TYPE_NO_NAMED_ARGS_STDARG_P (funtype)) && targetm.calls.strict_argument_naming (args_so_far)) ; doesn't change it. Jakub