https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97989
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 49627 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49627&action=edit gcc11-pr97989.patch That can be handled by this patch. But we can't retroactively apply it to released versions (and it is as a behavior change inappropriate for release branches either). So you need to filter out -g3 out of the flags yourself then, like one needs to filter out the above mentioned -d* options anyway.