From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B0F7B3857838; Tue, 7 Mar 2023 15:29:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B0F7B3857838 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678202958; bh=SZyuJwDY7ms5sJQ/0QOkzP+e69EnHu8S5wNIloEda6c=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gcJP4lxGa5trs4IPmKI8QhVx4D2yqJUAtM6vbeK07AGZAy9sXDDQTKZp5yZeM9FmM YWPh179fDwDmdhRv2xKshUT412i9B5Z4E9YoKCLLjLTbCmm4PTwwV2mu9+wSaoqJ4e tMT9zCrzTnDozrEt4jnwtSzsCbbHqzlNSjm28eLU= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109042] [13 Regression] ICE in emit_support_tinfo_1, at cp/rtti.cc:1584 Date: Tue, 07 Mar 2023 15:29:18 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109042 --- Comment #3 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:0d573c1f002fa77a4483aa9ebe310746a313082e commit r13-6527-g0d573c1f002fa77a4483aa9ebe310746a313082e Author: Jakub Jelinek Date: Tue Mar 7 16:28:20 2023 +0100 c++: Fix up ICE in emit_support_tinfo_1 [PR109042] In my recent rtti.cc change I assumed when emitting the support tinfos that the tinfos for the fundamental types haven't been created yet. Normally (in libsupc++.a (fundamental_type_info.o)) that is the case, but as can be seen on the testcase, one can violate it by using typeid etc. in the same TU and do it before ~__fundamental_type_info () definition. The following patch fixes that by popping from unemitted_tinfo_decls only in the normal case when it is there, and treating non-NULL DECL_INITIAL on a tinfo node as indication that emit_tinfo_decl has processed it already. 2023-03-07 Jakub Jelinek PR c++/109042 * rtti.cc (emit_support_tinfo_1): Don't assert that last unemitted_tinfo_decls element is tinfo, instead pop from it onl= y in that case. * decl2.cc (c_parse_final_cleanups): Don't call emit_tinfo_decl for unemitted_tinfO_decls which have already non-NULL DECL_INIT= IAL. * g++.dg/rtti/pr109042.C: New test.=