From patchwork Wed Mar 20 16:07:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1914159 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=N3vujpai; 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 4V0D5f3JX0z1yWy for ; Thu, 21 Mar 2024 03:08:06 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3A2EE3857C49 for ; Wed, 20 Mar 2024 16:08:04 +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 EECBD3857C69 for ; Wed, 20 Mar 2024 16:07:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EECBD3857C69 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 EECBD3857C69 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=1710950861; cv=none; b=oghbUhhaPCtsgt1RPQ912ofFcgidbQ2oPwNZi89ib1hUG3OwgfS9y+vGGSoRweViPJMJ2Yel8tYebAjg5Inarsw/Tfo2ow2b5LbAO8TlssVYKcmra0TdA/nsmFXJrVMadOZNokA8Jgko+qMjufQVp+U2mZNCOoSrPF4Ol1nQhG8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710950861; c=relaxed/simple; bh=4kTtLgJq9ByMD1K27/8rH97Uugrpw9qdbNZgKqwUe6I=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=vh6CeWUcgUz0gjbrl+12xhNeVblvZ65Hk456syGJkp4oVwf+dyF0igol/AiVhMQAuQCijJhtOzw3qtyNSbm8SrXxu8xp2334gATFNZDWdRoUAjror78wi9pMFqiMTRkpUoDGrxyq+ZwppwRAk27uE4niDHiJeIZZRxsQl+gKP7Y= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710950859; 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=GsOaGAGZc837qyVRL0zKbEiQ/r4wipj0M4PRgIKQPao=; b=N3vujpaiLkUDcP03ltAmRxUte7fezQjmQt14E0h3qaBUUj6cx9gZ5i4eIG8xXO95r852eL Fa53M9/9/sWYgmU1N8JegEn9HdWlKCQeQXx2a3rUjlXT486WwoYn+7VHhkYnEfUO/RI0dh Q55CYVcnZasedgDf3sEToA6bc/oMn0Q= 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-117-x2XM8DpNM-Sw2qAA2Iq7Eg-1; Wed, 20 Mar 2024 12:07:37 -0400 X-MC-Unique: x2XM8DpNM-Sw2qAA2Iq7Eg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (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 2DF5A2802277 for ; Wed, 20 Mar 2024 16:07:37 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E5EE72166B34 for ; Wed, 20 Mar 2024 16:07:36 +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 42KG7UDH1166360 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Wed, 20 Mar 2024 17:07:31 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 42KG7U8g1166359 for gcc-patches@gcc.gnu.org; Wed, 20 Mar 2024 17:07:30 +0100 Date: Wed, 20 Mar 2024 17:07:29 +0100 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [committed] nios2: Fix up nios2_setup_incoming_varargs [PR114175] Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 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, nios2 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/nios2/nios2.cc (nios2_setup_incoming_varargs): Only skip nios2_function_arg_advance for TYPE_NO_NAMED_ARGS_STDARG_P functions if arg.type is NULL. Jakub --- gcc/config/nios2/nios2.cc.jj 2024-01-03 12:01:15.414592108 +0100 +++ gcc/config/nios2/nios2.cc 2024-03-20 16:14:07.051020226 +0100 @@ -3525,7 +3525,8 @@ nios2_setup_incoming_varargs (cumulative cfun->machine->uses_anonymous_args = 1; local_cum = *cum; - 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) nios2_function_arg_advance (local_cum_v, arg); regs_to_push = NUM_ARG_REGS - local_cum.regs_used;