https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78265
--- Comment #2 from David Blaikie <dblaikie at gmail dot com> --- A side note/commentary: Producing debug info for global variable declarations at all is an interesting choice. If the whole program is built with debug info*, the global variable's definition will have debug info and that should suffice, I think. (* other optimizations in debug info that are the default for GCC make this assumption (the vtable based class debug info optimization: struct foo { virtual void f(); }; foo f; /* 'foo' emitted as a declaration here, a definition wherever 'foo::f' is defined), so it would seem consistent to never emit debug info for global variable declarations - with a flag to turn off this assumption/optimization) I mention this as it may make it easier to address this bug that way (though, understandably, supporting the old behavior under a flag would be good and thus this bug would still be an issue whenever that flag was used)