https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117696
Bug ID: 117696
Summary: LTO ignores -g3 debug info level
Product: gcc
Version: 14.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: rdiez-2006 at rd10 dot de
Target Milestone: ---
LTO seems to ignore the -g3 debug info level, which means macro definitions are
not included in the debug information.
I asked about it in the mailing list in February 2020, but got no answer:
Debug info with C macros (-g3) not honoured in LTO builds
https://gcc.gnu.org/legacy-ml/gcc-help/2020-02/msg00064.html
Other people have noticed too:
https://stackoverflow.com/questions/45340933/gcc-can-not-combine-flto-with-g-so-how-to-generate-debug-info
If it does not work, then it should at least be documented in the GCC manual.
It would also be nice if GCC could emit a warning when using -flto and -g3
together.