https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99456
Bug ID: 99456
Summary: [11 regression] ABI breakage with some static
initialization
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: nathan at gcc dot gnu.org
Target Milestone: ---
Created attachment 50326
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50326&action=edit
testcase
I've noticed some poorer behaviour in trunk than gcc10 with emitting inline
vars. The example when compiled with gcc-10 -std=c++17 emits only those vars
that are reachable from the externally visible vars. I.e. Var1...Var4 are NOT
present. Further all vars are statically initialized with no global
initializer function.
(This is regardless of optimization level).
With trunk, all the inline vars are emitted, even when not referenced.
Further, there is a gloabl initializer function emitted, that only tests and
sets their respective guard variables, with two exceptions.
Var3 and Var13 are dynamically initialized. This is an abi breakage.
I attach the two assembly files generated (the source presumes LP32 or LP64
ABI)