From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 023DE3858D28; Thu, 5 Jan 2023 11:41:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 023DE3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1672918897; bh=zNFOQJYN8LGXJVoKsv3+OTMRrBFxWAR1AgIKzUbRZGY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Djml11sAyIs+MmswZRxrF0VLqA5Z5HjH9JowoWPCIN7wX+5n69lI7pOGxbXq0+Bht XYAgPCCJH3F0tQVDkY1zleemYn01LKchJM4Y4Y+gBUczpWuPBJpQUgPrSq9izAD9fP mI07OhmdBR8frc1Plf2jufagn7Rr3HDrf8sr6oO8= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/108299] toplevel thread_local variables are not initialized if not referenced and initialized at wrong moment when referenced Date: Thu, 05 Jan 2023 11:41:36 +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: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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: bug_status cc resolution 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=3D108299 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED CC| |jakub at gcc dot gnu.org Resolution|--- |INVALID --- Comment #1 from Jakub Jelinek --- I don't think your claims are based on anything in the standard. The standard clearly says that it is implementation defined if non-block thread_local vars are dynamically initialized right away or deferred and initialized on first non-initialization odr-use. The latter is what GCC implements.=