From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8D63A3858D3C; Wed, 28 Dec 2022 09:39:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8D63A3858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1672220367; bh=rukXZfiPTqckQ1UN3QLpqnXge4z1xs6c7y76w0G+XvY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Lz7k5X9cLlvzdRcuMcSyFixoMwgXzItXRk5sJRIhOghCbN26T3N84FwFd7L7K1Xuh nK3U+HzM/9XfMlwqtPUlpILfprGGlJx59/+hlruHM+1/2V68DzCU3sCfkxOteEybpR kB8FIo9r3CJQjGY8gKB09OvOXiDFbNT+Wzco6I84= From: "marxin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107597] LTO causes static inline variables to get a non-uniqued global symbol Date: Wed, 28 Dec 2022 09:39:26 +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: 11.3.1 X-Bugzilla-Keywords: lto, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: marxin at gcc dot gnu.org X-Bugzilla-Status: NEW 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: assigned_to bug_status 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=3D107597 Martin Li=C5=A1ka changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|marxin at gcc dot gnu.org |unassigned at gcc d= ot gnu.org Status|ASSIGNED |NEW --- Comment #6 from Martin Li=C5=A1ka --- > So this is kind of feature. How the ODR violations are detected? > I wonder if keeping weak flag disturbs something. ASAN emits so-called ODR indicators for all global symbols that survive the following check: asan_needs_odr_indicator_p (tree decl) in asan.cc:3216 And that's we see 2 of them: marxin@marxinbox:~/Programming/testcases/PR107597> nm libTest1.so | grep odr 00000000000040c0 B __odr_asan._ZN12NonTemplated1xE marxin@marxinbox:~/Programming/testcases/PR107597> nm libTest2.so | grep odr 00000000000040c0 B __odr_asan._ZN12NonTemplated1xE which eventually ends up with the run-time error.=