On Thu, 2017-10-26 at 11:38 +0200, Richard Biener wrote: > You can eventually keep the option, marking it as Ignore (like we do > for options we remove but "keep" for backward compatibility). The > diagnostic (as warning, given the option will be just ignored) could > be emited from option processing in opts.c then.
I seriously doubt that anyone will miss the -gcoff option. The last bug report I can find is https://gcc.gnu.org/bugzilla/show_bug.cgi?id=9963 which was fixed in 2005. There is also a bug report from 2004 https://gcc.gnu.org/ml/gcc/2004-06/msg00708.html which suggests it should just be removed instead of fixed. I see Kai Tietz fixing some bugs in sdbout in 2014, but that is only because he was doing cygwin maintenance, and these problems turned up during testsuite debug torture testing. So it wasn't an end user problem. Also, in this thread, there are questions about why we don't just delete it instead. If we ignore the option, we can't have code in opts.c to emit a warning for it, but we can put a warning in the common.opt file. I tried this and ran into a minor problem which is that the code to check the debug level only works for options that exist. So I get palantir:2277$ ./xgcc -B./ -O -S -gcoff tmp.c xgcc: warning: switch ‘-gcoff’ no longer supported palantir:2278$ ./xgcc -B./ -O -S -gcoff3 tmp.c xgcc: warning: switch ‘-gcoff3’ no longer supported palantir:2279$ ./xgcc -B./ -O -S -gcofffoo tmp.c xgcc: warning: switch ‘-gcofffoo’ no longer supported palantir:2280$ The last one has never been a valid option. If we don't care about this, then the attached patch works. Otherwise I think I have to add 4 stanzas for the four valid options, -gcoff, -gcoff1, -gcoff2, and -gcoff3. I'd rather not do that. Or leave -gcoff in as a supported option and ignore it in opts.c, which I would also rather not do. I just want it gone. I can live with the ignored option. OK? Jim
2017-10-26 Jim Wilson <wil...@tuliptree.org> gcc/ * common.opt (gcoff): Re-add as ignored option. diff --git a/gcc/common.opt b/gcc/common.opt index 25e86ec..c248d95 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -2868,6 +2868,10 @@ g Common Driver RejectNegative JoinedOrMissing Generate debug information in default format. +gcoff +Common Driver JoinedOrMissing Ignore Warn(switch %qs no longer supported) +Does nothing. Preserved for backward compatibility. + gcolumn-info Common Driver Var(debug_column_info,1) Init(1) Record DW_AT_decl_column and DW_AT_call_column in DWARF.