From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9EEC33858416; Thu, 16 Mar 2023 23:25:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9EEC33858416 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679009159; bh=HjAfW4NsPiXWfsQdSwYLQbhYc3jYzHBp+cnoTXeWKfU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Hsws6N+8ihJZxqa6UxSj1bD0efEq4SeFVwA8RVPVeos6jm/f7I1OA5QYUhjDyvr7m m1piV9JRpop5OFGepHBYYuNwh8IeWV8Yd5l4s47XU/m9GP0mQEDUJ+Ip6zz/YXh75j 3qGE//BErTs+zNWLVaIt6ptajTM9wKMIDhVmzJ3s= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109164] thread_local initialization error with -ftree-pre Date: Thu, 16 Mar 2023 23:25:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 12.1.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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: short_desc cf_known_to_fail 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=3D109164 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|thread_local initialization |thread_local initialization |error with -ftree-pre |error with -ftree-pre |-foptimize-sibling-calls | Known to fail| |11.3.0 --- Comment #1 from Andrew Pinski --- Here is a testcase which fails at `-O1 -ftree-pre` and does not need `-foptimize-sibling-calls`: struct Struct { virtual void virtual_func(); }; extern thread_local Struct& thread_local_ref; bool other_func(void); bool test_func(void) { while (1) { thread_local_ref.virtual_func(); if (!other_func()) return 0; } }=