https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81155
--- Comment #10 from Jan Kratochvil <jan.kratochvil at redhat dot com> --- It should affect all functions, not just main. But then GDB already needlessly expands so many CUs that usually when some function is needed its CU is already expanded. So maybe it is seen just accidentally on one trivial testcase.