From patchwork Wed Mar 20 16:05:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1914156 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=WC581U/d; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V0D464kPmz1yWy for ; Thu, 21 Mar 2024 03:06:46 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 69A15385829A for ; Wed, 20 Mar 2024 16:06:44 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 677DF3857C7E for ; Wed, 20 Mar 2024 16:05:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 677DF3857C7E 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 677DF3857C7E 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=1710950759; cv=none; b=DEWajX7N/p29RuS3nbix7BczglewWt64mSjArmHqHpI78VlPoOS7TcRZqvfzvz7DTnn9Hh/3WyC4DQRjpjbmgEQXkqfX9xuGUiaM/QjCpODhPHWDRIJbQPxiKVCIhvRphPVE7kgUEY/MBpiKq1NwExBjTsmpBvMos38mn5C3/eM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710950759; c=relaxed/simple; bh=ZPU24ZBRDRJ9HdfmV5yzLdqLCkh5U9g2qtCQ4O1PZ5c=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=GoW6hj1MCTD9D/tHp9SYg2WXoWBOFuzlOxfoqaN9QtEwCkZRpcSmzAZqt2SpR+442k+mzrEeVN6VDrwq2W3KtN0PmE3Z0a0GyAJbUEWqK7O2tTt9xaeRdOTm3nmh85qfgmSaCPYexDQ5qpbp9eoEGoYUFGU3d2DDQj/4q6y7I6Y= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710950752; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type; bh=3Rgk2O2O4s86SXUC/cbXNv872Fac/uJBFBS863n6X0M=; b=WC581U/dGjTjon/U/G6QeWdIX7gLTwYdOKpoLNmjOCshouDIWQBww1Ld0AHv1JpcoiYH1O 4vmHP24j25J7FX228CiD41MjvVJ/KhoYeUqDDhrmDM9TYohXgTnJ6l3WPyX/p/k865z9uE ZlMBmy8rS0OFxEVV4tdWzKJovyS8zXE= 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-138-Sx1_6qIsN5q5perdx_WjfA-1; Wed, 20 Mar 2024 12:05:50 -0400 X-MC-Unique: Sx1_6qIsN5q5perdx_WjfA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (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 F3B31101A552 for ; Wed, 20 Mar 2024 16:05:49 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B71A4111DCF0 for ; Wed, 20 Mar 2024 16:05:49 +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 42KG5hJ01166339 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Wed, 20 Mar 2024 17:05:43 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 42KG5hmK1166338 for gcc-patches@gcc.gnu.org; Wed, 20 Mar 2024 17:05:43 +0100 Date: Wed, 20 Mar 2024 17:05:42 +0100 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [committed] ft32: Fix up ft32_setup_incoming_varargs [PR114175] Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.6 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Hi! Like for x86-64, alpha or rs6000, ft32 seems to be affected too. Just visually checked differences in c23-stdarg-9.c assembly in a cross without/with the patch, committed to trunk. 2024-03-20 Jakub Jelinek PR target/114175 * config/ft32/ft32.cc (ft32_setup_incoming_varargs): Only skip function arg advance for TYPE_NO_NAMED_ARGS_STDARG_P functions if arg.type is NULL. Jakub --- gcc/config/ft32/ft32.cc.jj 2024-01-03 12:01:22.988486000 +0100 +++ gcc/config/ft32/ft32.cc 2024-03-20 16:11:41.804969813 +0100 @@ -635,9 +635,10 @@ ft32_setup_incoming_varargs (cumulative_ { CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); int named_size = 0; - if (!TYPE_NO_NAMED_ARGS_STDARG_P (TREE_TYPE (current_function_decl))) - named_size = - GET_MODE_SIZE (SImode) * (*cum - FT32_R0) + GET_MODE_SIZE (arg.mode); + if (!TYPE_NO_NAMED_ARGS_STDARG_P (TREE_TYPE (current_function_decl)) + || arg.type != NULL_TREE) + named_size + = GET_MODE_SIZE (SImode) * (*cum - FT32_R0) + GET_MODE_SIZE (arg.mode); if (named_size < 24) *pretend_size = 24 - named_size;