From: Richard Biener Date: Thu, 23 Mar 2023 15:56:53 +0000 (+0100) Subject: lto/109263 - lto-wrapper and -g0 -ggdb X-Git-Tag: releases/gcc-12.3.0~106 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=42b3d387f7335a4bc8846e3b7a2a78fb47be68b2;p=thirdparty%2Fgcc.git lto/109263 - lto-wrapper and -g0 -ggdb The following makes lto-wrapper deal with non-combined debug disabling / enabling option combinations properly. Interestingly -gno-dwarf also enables debug. PR lto/109263 * lto-wrapper.cc (run_gcc): Parse alternate debug options as well, they always enable debug. (cherry picked from commit 4cbd5ef0350d8ab04993eb4c48ab80999fb4f358) --- diff --git a/gcc/lto-wrapper.cc b/gcc/lto-wrapper.cc index 9fede90c277f..155ccce57ae3 100644 --- a/gcc/lto-wrapper.cc +++ b/gcc/lto-wrapper.cc @@ -1555,6 +1555,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;