From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1130) id AB8A63858C2C; Tue, 23 Jan 2024 11:11:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AB8A63858C2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706008274; bh=jq2IjFspkZDBT3vgn9cRXMR2+iatbWF0spgctlEZH6w=; h=From:To:Subject:Date:From; b=uObUNxwTEWAB43AMbE33/SxiYWhdEQBgCiMnVkzO/Kj7iYxr4KbWr9TaniRsDkOO1 k3rrNa9GbDJJID2V5dAF1DR1g84mtZ/9fXBj8dYcIq3VpKDWPC0R2oLEESEh+SZp/d iawyACAN9P8Za3PX+ztz2SfBqMidqXVaVwye05gc= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Richard Sandiford To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-8354] aarch64: Avoid registering duplicate C++ overloads [PR112989] X-Act-Checkin: gcc X-Git-Author: Richard Sandiford X-Git-Refname: refs/heads/trunk X-Git-Oldrev: 20e18106fac2d11ee43683291ff11d76da41d50b X-Git-Newrev: 659a5a908edd84894c2aa7f6f89468217d6894ca Message-Id: <20240123111114.AB8A63858C2C@sourceware.org> Date: Tue, 23 Jan 2024 11:11:14 +0000 (GMT) List-Id: https://gcc.gnu.org/g:659a5a908edd84894c2aa7f6f89468217d6894ca commit r14-8354-g659a5a908edd84894c2aa7f6f89468217d6894ca Author: Richard Sandiford Date: Tue Jan 23 11:10:41 2024 +0000 aarch64: Avoid registering duplicate C++ overloads [PR112989] 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. 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. Diff: --- 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,