https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100464
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> --- gcc has the -fcompare-debug option, which compiles twice, once with -g and once with -g -gtoggle and compares result, anything that fails with that option with an error about debug vs. non-debug differences or potential differences is a bug.