https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104053
Bug ID: 104053
Summary: const variable not exported with O1
Product: gcc
Version: 11.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: stsp at users dot sourceforge.net
Target Milestone: ---
const.cpp:
---
const int AAA=5;
---
Good run:
---
$ g++ -O0 -c -o const.o const.cpp
$ nm const.o |c++filt
0000000000000000 r AAA
---
Bad run:
---
$ g++ -O1 -c -o const.o const.cpp
$ nm const.o |c++filt
<empty output>
---