[1/5] Remove obsolete debugging formats from names list

Message ID 20231023005531.19921-1-mark@harmstone.com
State Accepted
Headers
Series [1/5] Remove obsolete debugging formats from names list |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Mark Harmstone Oct. 23, 2023, 12:55 a.m. UTC
  STABS and xcoff have been removed, but are still in debug_type_names,
which ought to match debug_type_masks. This results in the following
minor bug with GCC 13:

$ x86_64-pc-linux-gnu-gcc -gvms -c tmp.c
cc1: error: target system does not support the ‘dwarf-2’ debug format
---
 gcc/opts.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Richard Biener Oct. 23, 2023, 7:46 a.m. UTC | #1
On Mon, Oct 23, 2023 at 2:56 AM Mark Harmstone <mark@harmstone.com> wrote:
>
> STABS and xcoff have been removed, but are still in debug_type_names,
> which ought to match debug_type_masks. This results in the following
> minor bug with GCC 13:
>
> $ x86_64-pc-linux-gnu-gcc -gvms -c tmp.c
> cc1: error: target system does not support the ‘dwarf-2’ debug format

OK for trunk and branch.

Richard.

> ---
>  gcc/opts.cc | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gcc/opts.cc b/gcc/opts.cc
> index 573dcf8e497..8015cb7556a 100644
> --- a/gcc/opts.cc
> +++ b/gcc/opts.cc
> @@ -50,7 +50,7 @@ static void set_Wstrict_aliasing (struct gcc_options *opts, int onoff);
>
>  const char *const debug_type_names[] =
>  {
> -  "none", "stabs", "dwarf-2", "xcoff", "vms", "ctf", "btf"
> +  "none", "dwarf-2", "vms", "ctf", "btf"
>  };
>
>  /* Bitmasks of fundamental debug info formats indexed by enum
> @@ -65,7 +65,7 @@ static uint32_t debug_type_masks[] =
>  /* Names of the set of debug formats requested by user.  Updated and accessed
>     via debug_set_names.  */
>
> -static char df_set_names[sizeof "none stabs dwarf-2 xcoff vms ctf btf"];
> +static char df_set_names[sizeof "none dwarf-2 vms ctf btf"];
>
>  /* Get enum debug_info_type of the specified debug format, for error messages.
>     Can be used only for individual debug format types.  */
> --
> 2.41.0
>
  

Patch

diff --git a/gcc/opts.cc b/gcc/opts.cc
index 573dcf8e497..8015cb7556a 100644
--- a/gcc/opts.cc
+++ b/gcc/opts.cc
@@ -50,7 +50,7 @@  static void set_Wstrict_aliasing (struct gcc_options *opts, int onoff);
 
 const char *const debug_type_names[] =
 {
-  "none", "stabs", "dwarf-2", "xcoff", "vms", "ctf", "btf"
+  "none", "dwarf-2", "vms", "ctf", "btf"
 };
 
 /* Bitmasks of fundamental debug info formats indexed by enum
@@ -65,7 +65,7 @@  static uint32_t debug_type_masks[] =
 /* Names of the set of debug formats requested by user.  Updated and accessed
    via debug_set_names.  */
 
-static char df_set_names[sizeof "none stabs dwarf-2 xcoff vms ctf btf"];
+static char df_set_names[sizeof "none dwarf-2 vms ctf btf"];
 
 /* Get enum debug_info_type of the specified debug format, for error messages.
    Can be used only for individual debug format types.  */