diff mbox series

[06/13] remove sdb and -gcoff from non-target files

Message ID 1508967924.2379.35.camel@tuliptree.org
State New
Headers show
Series Removal of SDB debug info support | expand

Commit Message

Jim Wilson Oct. 25, 2017, 9:45 p.m. UTC
This removes the -gcoff option, and various sdb related references in
non-target files.  I also poison SDB_DEBUGGING_INFO and SDB_DEBUG.  I
didn't see any point in poisoning the other SDB_* macros, as no one has
used any of them in a very long time.

I noticed one odd thing from removing -gcoff, use of it or any other
unrecognized debug info type now gives an odd looking error message.

palantir:2016$ gcc -gfoo -S tmp.c
cc1: error: unrecognised debug output level ‘foo’
palantir:2017$ 

We probably should only emit this error when we have a number after -g,
and emit some other error when a non-number appears after -g, such as
"unrecognized debug info type 'foo'".  This is a separate problem that
I haven't tried to fix here.

Jim
gcc/
	* common.opt (gcoff): Delete.
	(gxcoff+): Update Negative chain.
	* defaults.h: Delete all references to SDB_DEBUGGING_INFO and
	SDB_DEBUG.
	* dwarf2out.c (gen_array_type_die): Change SDB to debuggers.
	* flag-types.h (enum debug_info_type): Delete SDB_DEBUG.
	* function.c (number_blocks): Delete SDB_DEBUGGING_INFO, SDB_DEBUG,
	and SDB references.
	(expand_function_start): Change sdb reference to past tense.
	(expand_function_end): Change sdb reference to past tense.
	* gcc.c (cpp_unique_options): Delete gcoff3 reference.
	* opts.c (debug_type_names): Delete coff entry.
	(common_handle_option): Delete OPT_gcoff case.
	* system.h (SDB_DEBUG, SDB_DEBUGGING_INFO): Poison.
---
 gcc/common.opt   |  6 +-----
 gcc/defaults.h   |  9 +--------
 gcc/dwarf2out.c  | 12 ++++++------
 gcc/flag-types.h |  1 -
 gcc/function.c   | 10 +++++-----
 gcc/gcc.c        |  2 +-
 gcc/opts.c       |  6 +-----
 gcc/system.h     |  3 ++-
 8 files changed, 17 insertions(+), 32 deletions(-)

Comments

Richard Biener Oct. 26, 2017, 9:38 a.m. UTC | #1
On Wed, Oct 25, 2017 at 11:45 PM, Jim Wilson <wilson@tuliptree.org> wrote:
> This removes the -gcoff option, and various sdb related references in
> non-target files.  I also poison SDB_DEBUGGING_INFO and SDB_DEBUG.  I
> didn't see any point in poisoning the other SDB_* macros, as no one has
> used any of them in a very long time.
>
> I noticed one odd thing from removing -gcoff, use of it or any other
> unrecognized debug info type now gives an odd looking error message.
>
> palantir:2016$ gcc -gfoo -S tmp.c
> cc1: error: unrecognised debug output level ‘foo’
> palantir:2017$
>
> We probably should only emit this error when we have a number after -g,
> and emit some other error when a non-number appears after -g, such as
> "unrecognized debug info type 'foo'".  This is a separate problem that
> I haven't tried to fix here.

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.

Richard.

> Jim
>
>         gcc/
>         * common.opt (gcoff): Delete.
>         (gxcoff+): Update Negative chain.
>         * defaults.h: Delete all references to SDB_DEBUGGING_INFO and
>         SDB_DEBUG.
>         * dwarf2out.c (gen_array_type_die): Change SDB to debuggers.
>         * flag-types.h (enum debug_info_type): Delete SDB_DEBUG.
>         * function.c (number_blocks): Delete SDB_DEBUGGING_INFO, SDB_DEBUG,
>         and SDB references.
>         (expand_function_start): Change sdb reference to past tense.
>         (expand_function_end): Change sdb reference to past tense.
>         * gcc.c (cpp_unique_options): Delete gcoff3 reference.
>         * opts.c (debug_type_names): Delete coff entry.
>         (common_handle_option): Delete OPT_gcoff case.
>         * system.h (SDB_DEBUG, SDB_DEBUGGING_INFO): Poison.
> ---
>  gcc/common.opt   |  6 +-----
>  gcc/defaults.h   |  9 +--------
>  gcc/dwarf2out.c  | 12 ++++++------
>  gcc/flag-types.h |  1 -
>  gcc/function.c   | 10 +++++-----
>  gcc/gcc.c        |  2 +-
>  gcc/opts.c       |  6 +-----
>  gcc/system.h     |  3 ++-
>  8 files changed, 17 insertions(+), 32 deletions(-)
>
> diff --git a/gcc/common.opt b/gcc/common.opt
> index 836f05b..25e86ec 100644
> --- a/gcc/common.opt
> +++ b/gcc/common.opt
> @@ -2868,10 +2868,6 @@ g
>  Common Driver RejectNegative JoinedOrMissing
>  Generate debug information in default format.
>
> -gcoff
> -Common Driver JoinedOrMissing Negative(gdwarf)
> -Generate debug information in COFF format.
> -
>  gcolumn-info
>  Common Driver Var(debug_column_info,1) Init(1)
>  Record DW_AT_decl_column and DW_AT_call_column in DWARF.
> @@ -2937,7 +2933,7 @@ Common Driver JoinedOrMissing Negative(gxcoff+)
>  Generate debug information in XCOFF format.
>
>  gxcoff+
> -Common Driver JoinedOrMissing Negative(gcoff)
> +Common Driver JoinedOrMissing Negative(gdwarf)
>  Generate debug information in extended XCOFF format.
>
>  Enum
> diff --git a/gcc/defaults.h b/gcc/defaults.h
> index 99cd9db..768c987 100644
> --- a/gcc/defaults.h
> +++ b/gcc/defaults.h
> @@ -894,14 +894,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
>  #define DEFAULT_GDB_EXTENSIONS 1
>  #endif
>
> -#ifndef SDB_DEBUGGING_INFO
> -#define SDB_DEBUGGING_INFO 0
> -#endif
> -
>  /* If more than one debugging type is supported, you must define
>     PREFERRED_DEBUGGING_TYPE to choose the default.  */
>
> -#if 1 < (defined (DBX_DEBUGGING_INFO) + (SDB_DEBUGGING_INFO) \
> +#if 1 < (defined (DBX_DEBUGGING_INFO) \
>           + defined (DWARF2_DEBUGGING_INFO) + defined (XCOFF_DEBUGGING_INFO) \
>           + defined (VMS_DEBUGGING_INFO))
>  #ifndef PREFERRED_DEBUGGING_TYPE
> @@ -913,9 +909,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
>  #elif defined DBX_DEBUGGING_INFO
>  #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
>
> -#elif SDB_DEBUGGING_INFO
> -#define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
> -
>  #elif defined DWARF2_DEBUGGING_INFO || defined DWARF2_LINENO_DEBUGGING_INFO
>  #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
>
> diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
> index 81c95ec..ab66baf 100644
> --- a/gcc/dwarf2out.c
> +++ b/gcc/dwarf2out.c
> @@ -20938,12 +20938,12 @@ gen_array_type_die (tree type, dw_die_ref context_die)
>      add_AT_unsigned (array_die, DW_AT_ordering, DW_ORD_col_major);
>
>  #if 0
> -  /* We default the array ordering.  SDB will probably do
> -     the right things even if DW_AT_ordering is not present.  It's not even
> -     an issue until we start to get into multidimensional arrays anyway.  If
> -     SDB is ever caught doing the Wrong Thing for multi-dimensional arrays,
> -     then we'll have to put the DW_AT_ordering attribute back in.  (But if
> -     and when we find out that we need to put these in, we will only do so
> +  /* We default the array ordering.  Debuggers will probably do the right
> +     things even if DW_AT_ordering is not present.  It's not even an issue
> +     until we start to get into multidimensional arrays anyway.  If a debugger
> +     is ever caught doing the Wrong Thing for multi-dimensional arrays,
> +     then we'll have to put the DW_AT_ordering attribute back in.  (But
> +     if and when we find out that we need to put these in, we will only do so
>       for multidimensional arrays.  */
>    add_AT_unsigned (array_die, DW_AT_ordering, DW_ORD_row_major);
>  #endif
> diff --git a/gcc/flag-types.h b/gcc/flag-types.h
> index 2b23029..591b744 100644
> --- a/gcc/flag-types.h
> +++ b/gcc/flag-types.h
> @@ -24,7 +24,6 @@ enum debug_info_type
>  {
>    NO_DEBUG,        /* Write no debug info.  */
>    DBX_DEBUG,       /* Write BSD .stabs for DBX (using dbxout.c).  */
> -  SDB_DEBUG,       /* Write COFF for (old) SDB (using sdbout.c).  */
>    DWARF2_DEBUG,            /* Write Dwarf v2 debug info (using dwarf2out.c).  */
>    XCOFF_DEBUG,     /* Write IBM/Xcoff debug info (using dbxout.c).  */
>    VMS_DEBUG,        /* Write VMS debug info (using vmsdbgout.c).  */
> diff --git a/gcc/function.c b/gcc/function.c
> index 339419e..fe3d9c1 100644
> --- a/gcc/function.c
> +++ b/gcc/function.c
> @@ -4709,11 +4709,11 @@ number_blocks (tree fn)
>    int n_blocks;
>    tree *block_vector;
>
> -  /* For SDB and XCOFF debugging output, we start numbering the blocks
> +  /* For XCOFF debugging output, we start numbering the blocks
>       from 1 within each function, rather than keeping a running
>       count.  */
> -#if SDB_DEBUGGING_INFO || defined (XCOFF_DEBUGGING_INFO)
> -  if (write_symbols == SDB_DEBUG || write_symbols == XCOFF_DEBUG)
> +#if defined (XCOFF_DEBUGGING_INFO)
> +  if (write_symbols == XCOFF_DEBUG)
>      next_block_index = 1;
>  #endif
>
> @@ -5248,7 +5248,7 @@ expand_function_start (tree subr)
>      }
>
>    /* The following was moved from init_function_start.
> -     The move is supposed to make sdb output more accurate.  */
> +     The move was supposed to make sdb output more accurate.  */
>    /* Indicate the beginning of the function body,
>       as opposed to parm setup.  */
>    emit_note (NOTE_INSN_FUNCTION_BEG);
> @@ -5439,7 +5439,7 @@ expand_function_end (void)
>    do_pending_stack_adjust ();
>
>    /* Output a linenumber for the end of the function.
> -     SDB depends on this.  */
> +     SDB depended on this.  */
>    set_curr_insn_location (input_location);
>
>    /* Before the return label (if any), clobber the return
> diff --git a/gcc/gcc.c b/gcc/gcc.c
> index cec3ed5..184f2b3 100644
> --- a/gcc/gcc.c
> +++ b/gcc/gcc.c
> @@ -1117,7 +1117,7 @@ static const char *cpp_unique_options =
>   %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}}\
>   %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*}\
>   %{!E:%{!M:%{!MM:%{!MT:%{!MQ:%{MD|MMD:%{o*:-MQ %*}}}}}}}\
> - %{remap} %{g3|ggdb3|gstabs3|gcoff3|gxcoff3|gvms3:-dD}\
> + %{remap} %{g3|ggdb3|gstabs3|gxcoff3|gvms3:-dD}\
>   %{!iplugindir*:%{fplugin*:%:find-plugindir()}}\
>   %{H} %C %{D*&U*&A*} %{i*} %Z %i\
>   %{E|M|MM:%W{o*}}";
> diff --git a/gcc/opts.c b/gcc/opts.c
> index ee95c84..ac383d4 100644
> --- a/gcc/opts.c
> +++ b/gcc/opts.c
> @@ -37,7 +37,7 @@ static void set_Wstrict_aliasing (struct gcc_options *opts, int onoff);
>  /* Indexed by enum debug_info_type.  */
>  const char *const debug_type_names[] =
>  {
> -  "none", "stabs", "coff", "dwarf-2", "xcoff", "vms"
> +  "none", "stabs", "dwarf-2", "xcoff", "vms"
>  };
>
>  /* Parse the -femit-struct-debug-detailed option value
> @@ -2351,10 +2351,6 @@ common_handle_option (struct gcc_options *opts,
>                         loc);
>        break;
>
> -    case OPT_gcoff:
> -      set_debug_level (SDB_DEBUG, false, arg, opts, opts_set, loc);
> -      break;
> -
>      case OPT_gdwarf:
>        if (arg && strlen (arg) != 0)
>          {
> diff --git a/gcc/system.h b/gcc/system.h
> index 01bc134..5fab605 100644
> --- a/gcc/system.h
> +++ b/gcc/system.h
> @@ -1008,7 +1008,8 @@ extern void fancy_abort (const char *, int, const char *)
>         ROUND_TOWARDS_ZERO SF_SIZE DF_SIZE XF_SIZE TF_SIZE LIBGCC2_TF_CEXT \
>         LIBGCC2_LONG_DOUBLE_TYPE_SIZE STRUCT_VALUE                         \
>         EH_FRAME_IN_DATA_SECTION TARGET_FLT_EVAL_METHOD_NON_DEFAULT        \
> -       JCR_SECTION_NAME TARGET_USE_JCR_SECTION
> +       JCR_SECTION_NAME TARGET_USE_JCR_SECTION SDB_DEBUGGING_INFO         \
> +       SDB_DEBUG
>
>  /* Hooks that are no longer used.  */
>   #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE  \
> --
> 2.7.4
>
>
Jim Wilson Oct. 26, 2017, 10:12 p.m. UTC | #2
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  <wilson@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.
Richard Biener Oct. 27, 2017, 8:45 a.m. UTC | #3
On Fri, Oct 27, 2017 at 12:12 AM, Jim Wilson <wilson@tuliptree.org> wrote:
> 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?

Does

gcoff
Common Driver JoinedOrMissing Ignore Warn(switch %qs no longer supported)
Does nothing.  Preserved for backward compatibility.

gcoff1
Common Driver Alias(gcoff)

gcoff2
Common Driver Alias(gcoff)

gcoff3
Common Driver Alias(gcoff)

work to that effect?  Not sure if we really should care ;)

I'm ok with your patch as approved or the Alias variant if it
avoids the odd warnings for options that never existed
and you're fine with the reduced duplication.

Thanks,
Richard.

> Jim
>
> 2017-10-26  Jim Wilson  <wilson@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.
>
Jim Wilson Oct. 29, 2017, 11:09 p.m. UTC | #4
On Fri, 2017-10-27 at 10:45 +0200, Richard Biener wrote:
> Does
> 
> gcoff
> Common Driver JoinedOrMissing Ignore Warn(switch %qs no longer
> supported)
> Does nothing.  Preserved for backward compatibility.
> 
> gcoff1
> Common Driver Alias(gcoff)
> 
> gcoff2
> Common Driver Alias(gcoff)
> 
> gcoff3
> Common Driver Alias(gcoff)
> 
> work to that effect?  Not sure if we really should care ;)
> 
> I'm ok with your patch as approved or the Alias variant if it
> avoids the odd warnings for options that never existed
> and you're fine with the reduced duplication.

This doesn't work, because you can't have an alias to an ignored
option.  The alias support uses an OPT_x enum value to point back to
the other option, and there is no OPT_x enum value created for ignored
options.

This does work if I duplicate the gcoff entry 4 times for the 4
options, without the JoinedOrMissing, which is unnecessary if we
explicitly list them all.  This seems to be the only easy way to get
the exact result we need, and doesn't look too bad, so this is what I
checked in.

Jim
2017-10-29  Jim Wilson  <wilson@tuliptree.org>

	gcc/
	* common.opt (gcoff): Re-add as ignored option.
	(gcoff1, gcoff2, gcoff3): Likewise.

diff --git a/gcc/common.opt b/gcc/common.opt
index 25e86ec..5cf270c 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -2868,6 +2868,22 @@ g
 Common Driver RejectNegative JoinedOrMissing
 Generate debug information in default format.
 
+gcoff
+Common Driver Ignore Warn(switch %qs no longer supported)
+Does nothing.  Preserved for backward compatibility.
+
+gcoff1
+Common Driver Ignore Warn(switch %qs no longer supported)
+Does nothing.  Preserved for backward compatibility.
+
+gcoff2
+Common Driver Ignore Warn(switch %qs no longer supported)
+Does nothing.  Preserved for backward compatibility.
+
+gcoff3
+Common Driver 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.
diff mbox series

Patch

diff --git a/gcc/common.opt b/gcc/common.opt
index 836f05b..25e86ec 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -2868,10 +2868,6 @@  g
 Common Driver RejectNegative JoinedOrMissing
 Generate debug information in default format.
 
-gcoff
-Common Driver JoinedOrMissing Negative(gdwarf)
-Generate debug information in COFF format.
-
 gcolumn-info
 Common Driver Var(debug_column_info,1) Init(1)
 Record DW_AT_decl_column and DW_AT_call_column in DWARF.
@@ -2937,7 +2933,7 @@  Common Driver JoinedOrMissing Negative(gxcoff+)
 Generate debug information in XCOFF format.
 
 gxcoff+
-Common Driver JoinedOrMissing Negative(gcoff)
+Common Driver JoinedOrMissing Negative(gdwarf)
 Generate debug information in extended XCOFF format.
 
 Enum
diff --git a/gcc/defaults.h b/gcc/defaults.h
index 99cd9db..768c987 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -894,14 +894,10 @@  see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define DEFAULT_GDB_EXTENSIONS 1
 #endif
 
-#ifndef SDB_DEBUGGING_INFO
-#define SDB_DEBUGGING_INFO 0
-#endif
-
 /* If more than one debugging type is supported, you must define
    PREFERRED_DEBUGGING_TYPE to choose the default.  */
 
-#if 1 < (defined (DBX_DEBUGGING_INFO) + (SDB_DEBUGGING_INFO) \
+#if 1 < (defined (DBX_DEBUGGING_INFO) \
          + defined (DWARF2_DEBUGGING_INFO) + defined (XCOFF_DEBUGGING_INFO) \
          + defined (VMS_DEBUGGING_INFO))
 #ifndef PREFERRED_DEBUGGING_TYPE
@@ -913,9 +909,6 @@  see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #elif defined DBX_DEBUGGING_INFO
 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
 
-#elif SDB_DEBUGGING_INFO
-#define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
-
 #elif defined DWARF2_DEBUGGING_INFO || defined DWARF2_LINENO_DEBUGGING_INFO
 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
 
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 81c95ec..ab66baf 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -20938,12 +20938,12 @@  gen_array_type_die (tree type, dw_die_ref context_die)
     add_AT_unsigned (array_die, DW_AT_ordering, DW_ORD_col_major);
 
 #if 0
-  /* We default the array ordering.  SDB will probably do
-     the right things even if DW_AT_ordering is not present.  It's not even
-     an issue until we start to get into multidimensional arrays anyway.  If
-     SDB is ever caught doing the Wrong Thing for multi-dimensional arrays,
-     then we'll have to put the DW_AT_ordering attribute back in.  (But if
-     and when we find out that we need to put these in, we will only do so
+  /* We default the array ordering.  Debuggers will probably do the right
+     things even if DW_AT_ordering is not present.  It's not even an issue
+     until we start to get into multidimensional arrays anyway.  If a debugger
+     is ever caught doing the Wrong Thing for multi-dimensional arrays,
+     then we'll have to put the DW_AT_ordering attribute back in.  (But
+     if and when we find out that we need to put these in, we will only do so
      for multidimensional arrays.  */
   add_AT_unsigned (array_die, DW_AT_ordering, DW_ORD_row_major);
 #endif
diff --git a/gcc/flag-types.h b/gcc/flag-types.h
index 2b23029..591b744 100644
--- a/gcc/flag-types.h
+++ b/gcc/flag-types.h
@@ -24,7 +24,6 @@  enum debug_info_type
 {
   NO_DEBUG,	    /* Write no debug info.  */
   DBX_DEBUG,	    /* Write BSD .stabs for DBX (using dbxout.c).  */
-  SDB_DEBUG,	    /* Write COFF for (old) SDB (using sdbout.c).  */
   DWARF2_DEBUG,	    /* Write Dwarf v2 debug info (using dwarf2out.c).  */
   XCOFF_DEBUG,	    /* Write IBM/Xcoff debug info (using dbxout.c).  */
   VMS_DEBUG,        /* Write VMS debug info (using vmsdbgout.c).  */
diff --git a/gcc/function.c b/gcc/function.c
index 339419e..fe3d9c1 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -4709,11 +4709,11 @@  number_blocks (tree fn)
   int n_blocks;
   tree *block_vector;
 
-  /* For SDB and XCOFF debugging output, we start numbering the blocks
+  /* For XCOFF debugging output, we start numbering the blocks
      from 1 within each function, rather than keeping a running
      count.  */
-#if SDB_DEBUGGING_INFO || defined (XCOFF_DEBUGGING_INFO)
-  if (write_symbols == SDB_DEBUG || write_symbols == XCOFF_DEBUG)
+#if defined (XCOFF_DEBUGGING_INFO)
+  if (write_symbols == XCOFF_DEBUG)
     next_block_index = 1;
 #endif
 
@@ -5248,7 +5248,7 @@  expand_function_start (tree subr)
     }
 
   /* The following was moved from init_function_start.
-     The move is supposed to make sdb output more accurate.  */
+     The move was supposed to make sdb output more accurate.  */
   /* Indicate the beginning of the function body,
      as opposed to parm setup.  */
   emit_note (NOTE_INSN_FUNCTION_BEG);
@@ -5439,7 +5439,7 @@  expand_function_end (void)
   do_pending_stack_adjust ();
 
   /* Output a linenumber for the end of the function.
-     SDB depends on this.  */
+     SDB depended on this.  */
   set_curr_insn_location (input_location);
 
   /* Before the return label (if any), clobber the return
diff --git a/gcc/gcc.c b/gcc/gcc.c
index cec3ed5..184f2b3 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1117,7 +1117,7 @@  static const char *cpp_unique_options =
  %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}}\
  %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*}\
  %{!E:%{!M:%{!MM:%{!MT:%{!MQ:%{MD|MMD:%{o*:-MQ %*}}}}}}}\
- %{remap} %{g3|ggdb3|gstabs3|gcoff3|gxcoff3|gvms3:-dD}\
+ %{remap} %{g3|ggdb3|gstabs3|gxcoff3|gvms3:-dD}\
  %{!iplugindir*:%{fplugin*:%:find-plugindir()}}\
  %{H} %C %{D*&U*&A*} %{i*} %Z %i\
  %{E|M|MM:%W{o*}}";
diff --git a/gcc/opts.c b/gcc/opts.c
index ee95c84..ac383d4 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -37,7 +37,7 @@  static void set_Wstrict_aliasing (struct gcc_options *opts, int onoff);
 /* Indexed by enum debug_info_type.  */
 const char *const debug_type_names[] =
 {
-  "none", "stabs", "coff", "dwarf-2", "xcoff", "vms"
+  "none", "stabs", "dwarf-2", "xcoff", "vms"
 };
 
 /* Parse the -femit-struct-debug-detailed option value
@@ -2351,10 +2351,6 @@  common_handle_option (struct gcc_options *opts,
                        loc);
       break;
 
-    case OPT_gcoff:
-      set_debug_level (SDB_DEBUG, false, arg, opts, opts_set, loc);
-      break;
-
     case OPT_gdwarf:
       if (arg && strlen (arg) != 0)
         {
diff --git a/gcc/system.h b/gcc/system.h
index 01bc134..5fab605 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -1008,7 +1008,8 @@  extern void fancy_abort (const char *, int, const char *)
 	ROUND_TOWARDS_ZERO SF_SIZE DF_SIZE XF_SIZE TF_SIZE LIBGCC2_TF_CEXT \
 	LIBGCC2_LONG_DOUBLE_TYPE_SIZE STRUCT_VALUE			   \
 	EH_FRAME_IN_DATA_SECTION TARGET_FLT_EVAL_METHOD_NON_DEFAULT	   \
-	JCR_SECTION_NAME TARGET_USE_JCR_SECTION
+	JCR_SECTION_NAME TARGET_USE_JCR_SECTION SDB_DEBUGGING_INFO	   \
+	SDB_DEBUG
 
 /* Hooks that are no longer used.  */
  #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE	\