From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3ECC93858C2F; Tue, 16 Jan 2024 22:41:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3ECC93858C2F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705444863; bh=CMv4vtzi0ymCvcA7RuD3x/PXeZ2cbYFTEMrvUgceizc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=tccHeupH/+z+ACcfi+EFC74LXe5AlMpOx++PHZCFTblegiCaJRCHS+LUdqY1duAH0 tEYiIvGdMpBOPy3g4iZu9stF958Kby1uWoed1Zsdsn+kkRkh125T+IXvW0KRP86qMv u/oy6N+LrT4X+61qCLZOyZVi7ruCxdnPxWkJPTmY= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/113292] [modules] internal error when compiling header to module containing static thread_local variable Date: Tue, 16 Jan 2024 22:41:02 +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.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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=3D113292 --- Comment #1 from GCC Commits --- The master branch has been updated by Nathaniel Shead : https://gcc.gnu.org/g:14338386970bc6c2d46b81181f48622fdf25d705 commit r14-8168-g14338386970bc6c2d46b81181f48622fdf25d705 Author: Nathaniel Shead Date: Thu Jan 11 16:49:39 2024 +1100 c++: Support thread_local statics in header modules [PR113292] Currently, thread_locals in header modules cause ICEs. This patch makes the required changes for them to work successfully. This requires additionally writing the DECL_TLS_MODEL for thread-local variables to the module interface, and the TLS wrapper function needs to have its DECL_BEFRIENDING_CLASSES written too as this is used to retrieve what VAR_DECL it's a wrapper for when emitting a definition at end of TU processing. PR c++/113292 gcc/cp/ChangeLog: * decl2.cc (get_tls_wrapper_fn): Set DECL_CONTEXT. (c_parse_final_cleanups): Suppress warning for no definition of TLS wrapper functions in header modules. * module.cc (trees_out::lang_decl_vals): Write wrapped variable for TLS wrapper functions. (trees_in::lang_decl_vals): Read it. (trees_out::decl_value): Write TLS model for thread-local vars. (trees_in::decl_value): Read it for new decls. Remember to emit definitions of TLS wrapper functions later. gcc/testsuite/ChangeLog: * g++.dg/modules/pr113292_a.H: New test. * g++.dg/modules/pr113292_b.C: New test. * g++.dg/modules/pr113292_c.C: New test. Signed-off-by: Nathaniel Shead =