lto/109263 - lto-wrapper and -g0 -ggdb
Commit Message
The following makes lto-wrapper deal with non-combined debug
disabling / enabling option combinations properly. Interestingly
-gno-dwarf also enables debug.
Bootstrap / regtest running on x86_64-unknown-linux-gnu.
OK? Or do we want to try harder to zap earlier -g0 when later
-g* appear?
PR lto/109263
* lto-wrapper.c (run_gcc): Parse alternate debug options
as well, they always enable debug.
---
gcc/lto-wrapper.cc | 10 ++++++++++
1 file changed, 10 insertions(+)
Comments
On 3/23/23 10:00, Richard Biener via Gcc-patches wrote:
> The following makes lto-wrapper deal with non-combined debug
> disabling / enabling option combinations properly. Interestingly
> -gno-dwarf also enables debug.
>
> Bootstrap / regtest running on x86_64-unknown-linux-gnu.
>
> OK? Or do we want to try harder to zap earlier -g0 when later
> -g* appear?
>
> PR lto/109263
> * lto-wrapper.c (run_gcc): Parse alternate debug options
> as well, they always enable debug.
So I think the agreement was that later -g options override, but don't
completely disable. So OK.
Jeff
@@ -1564,6 +1564,16 @@ run_gcc (unsigned argc, char *argv[])
skip_debug = option->arg && !strcmp (option->arg, "0");
break;
+ case OPT_gbtf:
+ case OPT_gctf:
+ case OPT_gdwarf:
+ case OPT_gdwarf_:
+ case OPT_ggdb:
+ case OPT_gvms:
+ /* Negative forms, if allowed, enable debug info as well. */
+ skip_debug = false;
+ break;
+
case OPT_dumpdir:
incoming_dumppfx = dumppfx = option->arg;
break;