]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
lto/109263 - lto-wrapper and -g0 -ggdb
authorRichard Biener <rguenther@suse.de>
Thu, 23 Mar 2023 15:56:53 +0000 (16:56 +0100)
committerRichard Biener <rguenther@suse.de>
Mon, 17 Apr 2023 09:13:17 +0000 (11:13 +0200)
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)

gcc/lto-wrapper.cc

index 9fede90c277fe07ae6072ea9cff471b2fd6489c6..155ccce57ae3e6fbf8a729b2e8432b2c547f9470 100644 (file)
@@ -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;