From patchwork Tue Jan 23 11:12:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 1889663 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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 4TK4FJ4PrNz1yS7 for ; Tue, 23 Jan 2024 22:12:51 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AFD8D3858427 for ; Tue, 23 Jan 2024 11:12:48 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 710913858C2C for ; Tue, 23 Jan 2024 11:12:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 710913858C2C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 710913858C2C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706008346; cv=none; b=KuweyT5Vo8ZwXoGVpaNdmhITX1cETwMmKpYNpJNguewi4m4LPaPdLhwbYSq/OMSXm+gkNHht8hWW+UnFL57eT6+LtaBQyUaBvoERZKHdFCIIkrvQpbDxjektNat9zMKGMTncsAhbg1C//qFtsgC6b0VMs7lejXPwpMJVAXHJuT0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706008346; c=relaxed/simple; bh=TiHPYGVCjnRg85avL7GWjL0S5uc61trCCdcoq3jfNP4=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=qLGf59OIWWUyG22kVa0qnZ9ciiokXonFZBelCHNEfqnBwPFC6cXH7VN4bN+aJCIAqkZrKxarchzlYh21mXX9N3DHZjXrzNmIrGpYxXQ8iuFthGCTd79SLUvGXey/s8JtwdU331J2k8FVfxO8l17dPFUqM2BMeyDrZz/T9x3Kwss= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6BC8D1FB; Tue, 23 Jan 2024 03:13:09 -0800 (PST) Received: from localhost (e121540-lin.manchester.arm.com [10.32.110.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 914063F762; Tue, 23 Jan 2024 03:12:23 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, iain@sandoe.co.uk, richard.sandiford@arm.com Cc: iain@sandoe.co.uk Subject: [pushed] aarch64: Avoid registering duplicate C++ overloads [PR112989] Date: Tue, 23 Jan 2024 11:12:22 +0000 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Spam-Status: No, score=-21.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, 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: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org In the original fix for this PR, I'd made sure that including didn't reach the final return in simulate_builtin_function_decl (which would indicate duplicate function definitions). But it seems I forgot to do the same thing for C++, which defines all of its overloads directly. This patch fixes a case where we still recorded duplicate functions for C++. Thanks to Iain for reporting the resulting GC ICE and for help with reproducing it. Tested on aarch64-linux-gnu & pushed. Richard gcc/ PR target/112989 * config/aarch64/aarch64-sve-builtins-shapes.cc (build_one): Skip MODE_single variants of functions that don't take tuple arguments. --- gcc/config/aarch64/aarch64-sve-builtins-shapes.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gcc/config/aarch64/aarch64-sve-builtins-shapes.cc b/gcc/config/aarch64/aarch64-sve-builtins-shapes.cc index 2692b086ac5..f190770250f 100644 --- a/gcc/config/aarch64/aarch64-sve-builtins-shapes.cc +++ b/gcc/config/aarch64/aarch64-sve-builtins-shapes.cc @@ -338,6 +338,14 @@ build_one (function_builder &b, const char *signature, unsigned int ti, unsigned int gi, unsigned int pi, bool force_direct_overloads) { + /* For simplicity, function definitions are allowed to use the group + suffix lists vg2 and vg4 for shapes that have _single forms, + even though the _single form applies only to vgNx2 and vgNx4, + not to vgNx1. */ + if (mode_suffix_id == MODE_single + && group_suffixes[group.groups[gi]].vectors_per_tuple == 1) + return; + /* Byte forms of svdupq take 16 arguments. */ auto_vec argument_types; function_instance instance (group.base_name, *group.base, *group.shape,