From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 076983860C3E; Fri, 5 Mar 2021 10:00:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 076983860C3E From: "acoplan at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/99216] ICE in aarch64_sve::function_expander::expand() with LTO Date: Fri, 05 Mar 2021 10:00:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: acoplan at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: acoplan at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2021 10:00:30 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99216 --- Comment #4 from Alex Coplan --- Right, the problem appears to be to do with the way that overloaded functio= ns are implemented for the ACLE. Specifically the m_direct_overloads flag in aarch64_sve::function_builder. If this flag is set, we register a separate builtin (with a separate function code) for each overload as opposed to registering the overloaded function once and resolving it later. The two different schemes end up with each builtin having a different code. We set m_direct_overloads to be true if the language is C++: m_direct_overloads =3D lang_GNU_CXX (); so in cc1plus, we use one numbering scheme, but in lto1, we use a different numbering scheme, with predictably disastrous consequences (we try and expa= nd svaddv as an svbic). So one options would be that for LTO we instantiate both sets of tree nodes. Then, when expanding a tree node that came from LTO, we dispatch on a flag = in the tree node (essentially just whether it came from C++ or not) to determi= ne which set of functions to use. Seems a bit messy though. @Richard: does that sound at all sane? Any ideas for a better approach?=