On 11/26/20 1:39 AM, Jakub Jelinek via Gcc-patches wrote:
> Hi!
>
> The driver enables -dD when preprocessing when -g3 is specified, for obvious
> reasons
> that we need the macros to be preserved somewhere for them to make up the
> debug
> info. But it enables it even if -g3 is later overridden to -g2, -g1 or -g0,
> where we in the end don't emit .debug_mac{ros,info}.
>
> The following patch passes -dD only if we'll need it.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
>
> 2020-11-26 Jakub Jelinek <ja...@redhat.com>
>
> PR debug/97989
> * gcc.c (cpp_unique_options): Add -dD if %:debug-level-gt(2)
> rather than g3|ggdb3|gstabs3|gxcoff3|gvms3.
>
> * gcc.dg/cpp/pr97989-1.c: New test.
> * gcc.dg/cpp/pr97989-2.c: New test.
OK
jeff