https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87215
Bug ID: 87215
Summary: Unused debug info with -std=c++17
Product: gcc
Version: 8.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: debug
Assignee: unassigned at gcc dot gnu.org
Reporter: holger.hopp at sap dot com
Target Milestone: ---
gcc-7 and gcc-8 produce much more unused (?) debug info when compiling in C++17
mode (compared to C++14 or C++11 mode).
Seems that unused debug info elimination (-f[no-]eliminate-unused-debug-types )
does not work properly with C++17.
Source (not preprocessed, but simple):
#include <limits>
Reproduce:
g++ -std=c++14 -g -o limits-14.o -c limits.cpp
g++ -std=c++14 -g -fno-eliminate-unused-debug-types -o limits-14-ne.o -c
limits.cpp
g++ -std=c++17 -g -o limits-17.o -c limits.cpp
g++ -std=c++17 -g -fno-eliminate-unused-debug-types -o limits-17-ne.o -c
limits.cpp
g++ -std=c++17 -g -feliminate-unused-debug-types -o limits-17-e.o -c limits.cpp
wc -c limits*.o
With gcc-7 or gcc-8:
37872 limits-14-ne.o
3096 limits-14.o
69720 limits-17-e.o
69728 limits-17-ne.o
69688 limits-17.o
Ok with gcc-6:
36816 limits-14-ne.o
2864 limits-14.o
2888 limits-17-e.o
36816 limits-17-ne.o
2864 limits-17.o
(no difference between 'g++ -std=c++14 -E limits.cpp' and 'g++ -std=c++17 -E
limits.cpp' preprocessed outputs)