From patchwork Wed Mar 20 16:06:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1914158 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=PCJcITLA; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; 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 [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 4V0D5L1NsLz1yWy for ; Thu, 21 Mar 2024 03:07:50 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 188313857C7D for ; Wed, 20 Mar 2024 16:07:48 +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.129.124]) by sourceware.org (Postfix) with ESMTPS id 692AF3858D1E for ; Wed, 20 Mar 2024 16:07:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 692AF3858D1E 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 692AF3858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710950847; cv=none; b=k4DmtPY626chfrEX950sDiTmtdyJbowka5mgvYFoqfbI7VxfgXMR8tMBcqInsXl21ASNol7EQufwl75IK9hjI201C5PhUFCDbMi0x44/rL1/i/Ip+QDpfLM0ea1GMNZ7E0M7iSggrSG/FV79FP3ZbgKHKwirOAm/qaAZlazMOPs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710950847; c=relaxed/simple; bh=DPJL8hluHqv6pPLUM8Qz2Ga/W26QhAWdSX3oNs80pZ8=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=bsOc+NvUiv0arTw+7RuT6yQW0irhwE6GgDtNq5LwWdKHHMCiNF3fxWe2sZYM+PmaoS/dsVnc59HsPK/Ff5wwzh04egxAMhg8u0i5fdOHO0bVW+ZQ3Vd/fRhjwI1miXq78iNam/BUkAQ126Vpw9PGBgDXlKJV2jR5Jm5RFA5wcHs= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710950844; 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=n3w2QmKT+LgwNcfBhMtRWhrvap+6Js4UQZTP+ZFhVQY=; b=PCJcITLAYZhEW5k7rNrqEek0ru9UNB/Mswkc4rc53qzizhidPqqd5oqMZrNRUZQ+8mi9un cXOU7tLyUf6TAeSrSMxEmdT+9Cl67xq9vdtZYVKwG0At1h8nSzz2CJK5d78MHgP2EBJYBK uRi5K6XA+ESj0vaWKpLMIJ83f+pr3JA= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-201-K9kAfVcvN_-1Spb8W6-mWA-1; Wed, 20 Mar 2024 12:07:18 -0400 X-MC-Unique: K9kAfVcvN_-1Spb8W6-mWA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (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 5E8083C02B69 for ; Wed, 20 Mar 2024 16:07:18 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2259B40C6DAD for ; Wed, 20 Mar 2024 16:07:18 +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 42KG6rvu1166353 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Wed, 20 Mar 2024 17:06:54 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 42KG6rnT1166352 for gcc-patches@gcc.gnu.org; Wed, 20 Mar 2024 17:06:53 +0100 Date: Wed, 20 Mar 2024 17:06:53 +0100 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [committed] nds32: Fix up nds32_setup_incoming_varargs [PR114175] Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.9 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, nds32 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/nds32/nds32.cc (nds32_setup_incoming_varargs): Only skip function arg advance for TYPE_NO_NAMED_ARGS_STDARG_P functions if arg.type is NULL. Jakub --- gcc/config/nds32/nds32.cc.jj 2024-01-03 12:01:22.862487765 +0100 +++ gcc/config/nds32/nds32.cc 2024-03-20 16:13:47.460283181 +0100 @@ -2374,7 +2374,8 @@ nds32_setup_incoming_varargs (cumulative for varargs. */ total_args_regs = NDS32_MAX_GPR_REGS_FOR_ARGS + NDS32_GPR_ARG_FIRST_REGNUM; - if (!TYPE_NO_NAMED_ARGS_STDARG_P (TREE_TYPE (current_function_decl))) + if (!TYPE_NO_NAMED_ARGS_STDARG_P (TREE_TYPE (current_function_decl)) + || arg.type != NULL_TREE) num_of_used_regs = NDS32_AVAILABLE_REGNUM_FOR_GPR_ARG (cum->gpr_offset, arg.mode, arg.type) + NDS32_NEED_N_REGS_FOR_ARG (arg.mode, arg.type);