[PATCHv2] debug: make -feliminate-unused-debug-symbols the default [PR debug/86964]

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCHv2] debug: make -feliminate-unused-debug-symbols the default [PR debug/86964]

Thomas De Schampheleire
From: Thomas De Schampheleire <[hidden email]>

In addition to making -feliminate-unused-debug-symbols work for the DWARF
format (see [1]), make this option the default. This behavior was the case
before, e.g. under gcc 4.9.x.
[1] https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=269925

This change requires some updates to test cases, which expected the previous
default of not eliminating unused debug symbols.

gcc/ChangeLog:

2019-05-21  Thomas De Schampheleire  <[hidden email]>

        PR debug/86964
        * common.opt (feliminate-unused-debug-symbols): Enable by default.
        * doc/invoke.texi (Debugging Options): Document new default of
        -feliminate-unused-debug-symbols and remove restriction to 'stabs'.

gcc/testsuite/ChangeLog:

2019-05-21  Thomas De Schampheleire  <[hidden email]>

        PR debug/86964
        * g++.dg/debug/dwarf2/fesd-any.C: Use
        -fno-eliminate-unused-debug-symbols.
        * g++.dg/debug/dwarf2/fesd-baseonly.C: Likewise.
        * g++.dg/debug/dwarf2/fesd-none.C: Likewise.
        * g++.dg/debug/dwarf2/fesd-reduced.C: Likewise.
        * g++.dg/debug/dwarf2/fesd-sys.C: Likewise.
        * g++.dg/debug/dwarf2/inline-var-1.C: Likewise.
        * g++.dg/debug/enum-2.C: Likewise.
        * gcc.dg/debug/dwarf2/fesd-any.c: Likewise.
        * gcc.dg/debug/dwarf2/fesd-baseonly.c: Likewise.
        * gcc.dg/debug/dwarf2/fesd-none.c: Likewise.
        * gcc.dg/debug/dwarf2/fesd-reduced.c: Likewise.
        * gcc.dg/debug/dwarf2/fesd-sys.c: Likewise.
---
 gcc/common.opt                                    | 2 +-
 gcc/doc/invoke.texi                               | 9 +++++----
 gcc/testsuite/g++.dg/debug/dwarf2/fesd-any.C      | 2 +-
 gcc/testsuite/g++.dg/debug/dwarf2/fesd-baseonly.C | 2 +-
 gcc/testsuite/g++.dg/debug/dwarf2/fesd-none.C     | 2 +-
 gcc/testsuite/g++.dg/debug/dwarf2/fesd-reduced.C  | 2 +-
 gcc/testsuite/g++.dg/debug/dwarf2/fesd-sys.C      | 2 +-
 gcc/testsuite/g++.dg/debug/dwarf2/inline-var-1.C  | 2 +-
 gcc/testsuite/g++.dg/debug/enum-2.C               | 1 +
 gcc/testsuite/gcc.dg/debug/dwarf2/fesd-any.c      | 2 +-
 gcc/testsuite/gcc.dg/debug/dwarf2/fesd-baseonly.c | 2 +-
 gcc/testsuite/gcc.dg/debug/dwarf2/fesd-none.c     | 2 +-
 gcc/testsuite/gcc.dg/debug/dwarf2/fesd-reduced.c  | 2 +-
 gcc/testsuite/gcc.dg/debug/dwarf2/fesd-sys.c      | 2 +-
 14 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/gcc/common.opt b/gcc/common.opt
index d342c4f3749..0e72fd08ec4 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1379,7 +1379,7 @@ Common Report Var(flag_ipa_sra) Init(0) Optimization
 Perform interprocedural reduction of aggregates.
 
 feliminate-unused-debug-symbols
-Common Report Var(flag_debug_only_used_symbols)
+Common Report Var(flag_debug_only_used_symbols) Init(1)
 Perform unused symbol elimination in debug info.
 
 feliminate-unused-debug-types
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 5e3e8873d35..06c8c60f19e 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -388,7 +388,7 @@ Objective-C and Objective-C++ Dialects}.
 -fno-eliminate-unused-debug-types @gol
 -femit-struct-debug-baseonly  -femit-struct-debug-reduced @gol
 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
--feliminate-unused-debug-symbols  -femit-class-debug-always @gol
+-fno-eliminate-unused-debug-symbols  -femit-class-debug-always @gol
 -fno-merge-debug-strings  -fno-dwarf2-cfi-asm @gol
 -fvar-tracking  -fvar-tracking-assignments}
 
@@ -7827,10 +7827,11 @@ confusion with @option{-gdwarf-@var{level}}.
 Instead use an additional @option{-g@var{level}} option to change the
 debug level for DWARF.
 
-@item -feliminate-unused-debug-symbols
+@item -fno-eliminate-unused-debug-symbols
 @opindex feliminate-unused-debug-symbols
-Produce debugging information in stabs format (if that is supported),
-for only symbols that are actually used.
+@opindex fno-eliminate-unused-debug-symbols
+By default, no debug information is produced for symbols that are not actually
+used. Use this option if you want debug information for all symbols.
 
 @item -femit-class-debug-always
 @opindex femit-class-debug-always
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-any.C b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-any.C
index a4a0b50ee50..5868ebc9c85 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-any.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-any.C
@@ -1,5 +1,5 @@
 // { dg-do compile }
-// { dg-options "-gdwarf-2 -dA -femit-struct-debug-detailed=any" }
+// { dg-options "-gdwarf-2 -dA -femit-struct-debug-detailed=any -fno-eliminate-unused-debug-symbols" }
 // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
 // { dg-final { scan-assembler "tv_sec.*DW_AT_name" } }
 // { dg-final { scan-assembler "tv_nsec.*DW_AT_name" } }
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-baseonly.C b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-baseonly.C
index 4f580ebd361..fe0016a4563 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-baseonly.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-baseonly.C
@@ -1,5 +1,5 @@
 // { dg-do compile }
-// { dg-options "-gdwarf-2 -dA -femit-struct-debug-baseonly" }
+// { dg-options "-gdwarf-2 -dA -femit-struct-debug-baseonly -fno-eliminate-unused-debug-symbols" }
 // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
 // { dg-final { scan-assembler-not "tv_sec.*DW_AT_name" } }
 // { dg-final { scan-assembler-not "tv_nsec.*DW_AT_name" } }
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-none.C b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-none.C
index 0af0a83d85f..c5a33967426 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-none.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-none.C
@@ -1,5 +1,5 @@
 // { dg-do compile }
-// { dg-options "-gdwarf-2 -dA -femit-struct-debug-detailed=none" }
+// { dg-options "-gdwarf-2 -dA -femit-struct-debug-detailed=none -fno-eliminate-unused-debug-symbols" }
 // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
 // { dg-final { scan-assembler-not "tv_sec.*DW_AT_name" } }
 // { dg-final { scan-assembler-not "tv_nsec.*DW_AT_name" } }
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-reduced.C b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-reduced.C
index a93b90f05ad..ba40f176375 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-reduced.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-reduced.C
@@ -1,5 +1,5 @@
 // { dg-do compile }
-// { dg-options "-gdwarf-2 -dA -femit-struct-debug-reduced" }
+// { dg-options "-gdwarf-2 -dA -femit-struct-debug-reduced -fno-eliminate-unused-debug-symbols" }
 // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
 // { dg-final { scan-assembler "tv_sec.*DW_AT_name" } }
 // { dg-final { scan-assembler "tv_nsec.*DW_AT_name" } }
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-sys.C b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-sys.C
index 95a9a31ff60..86eeb21cf10 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-sys.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-sys.C
@@ -1,5 +1,5 @@
 // { dg-do compile }
-// { dg-options "-gdwarf-2 -dA -femit-struct-debug-detailed=sys" }
+// { dg-options "-gdwarf-2 -dA -femit-struct-debug-detailed=sys -fno-eliminate-unused-debug-symbols" }
 // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
 // { dg-final { scan-assembler "tv_sec.*DW_AT_name" } }
 // { dg-final { scan-assembler "tv_nsec.*DW_AT_name" } }
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/inline-var-1.C b/gcc/testsuite/g++.dg/debug/dwarf2/inline-var-1.C
index fc3e6fd435f..3b1c913edfc 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/inline-var-1.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/inline-var-1.C
@@ -1,5 +1,5 @@
 // { dg-do compile { target c++17 } }
-// { dg-options "-O -g -dA -gno-strict-dwarf" }
+// { dg-options "-O -g -dA -gno-strict-dwarf -fno-eliminate-unused-debug-symbols" }
 // { dg-require-weak "" }
 // { dg-final { scan-assembler-times "0x3\[^\n\r]* DW_AT_inline" 6 { xfail *-*-aix* } } }
 // { dg-final { scan-assembler-times "0x1\[^\n\r]* DW_AT_inline" 2 { xfail *-*-aix* } } }
diff --git a/gcc/testsuite/g++.dg/debug/enum-2.C b/gcc/testsuite/g++.dg/debug/enum-2.C
index d5501313d93..554de37c40a 100644
--- a/gcc/testsuite/g++.dg/debug/enum-2.C
+++ b/gcc/testsuite/g++.dg/debug/enum-2.C
@@ -1,5 +1,6 @@
 /* Verify that used enums are output.  */
 /* { dg-do compile } */
+/* { dg-options "-fno-eliminate-unused-debug-symbols" } */
 /* { dg-final { scan-assembler "JTI_MAX" } } */
 
 int var;
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-any.c b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-any.c
index 810788ae6e3..4062268e54c 100644
--- a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-any.c
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-any.c
@@ -1,5 +1,5 @@
 // { dg-do compile }
-// { dg-options "-gdwarf -dA -femit-struct-debug-detailed=any" }
+// { dg-options "-gdwarf -dA -femit-struct-debug-detailed=any -fno-eliminate-unused-debug-symbols" }
 // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
 // { dg-final { scan-assembler "tv_sec.*DW_AT_name" } }
 // { dg-final { scan-assembler "tv_nsec.*DW_AT_name" } }
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-baseonly.c b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-baseonly.c
index aefcb871509..fffdf04cfb6 100644
--- a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-baseonly.c
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-baseonly.c
@@ -1,5 +1,5 @@
 // { dg-do compile }
-// { dg-options "-gdwarf -dA -femit-struct-debug-baseonly" }
+// { dg-options "-gdwarf -dA -femit-struct-debug-baseonly -fno-eliminate-unused-debug-symbols" }
 // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
 // { dg-final { scan-assembler-not "tv_sec.*DW_AT_name" } }
 // { dg-final { scan-assembler-not "tv_nsec.*DW_AT_name" } }
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-none.c b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-none.c
index 193c05d6155..6fba51287ef 100644
--- a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-none.c
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-none.c
@@ -1,5 +1,5 @@
 // { dg-do compile }
-// { dg-options "-gdwarf -dA -femit-struct-debug-detailed=none" }
+// { dg-options "-gdwarf -dA -femit-struct-debug-detailed=none -fno-eliminate-unused-debug-symbols" }
 // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
 // { dg-final { scan-assembler-not "tv_sec.*DW_AT_name" } }
 // { dg-final { scan-assembler-not "tv_nsec.*DW_AT_name" } }
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-reduced.c b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-reduced.c
index ebbfc36672b..4209e30e3f9 100644
--- a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-reduced.c
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-reduced.c
@@ -1,5 +1,5 @@
 // { dg-do compile }
-// { dg-options "-gdwarf -dA -femit-struct-debug-reduced" }
+// { dg-options "-gdwarf -dA -femit-struct-debug-reduced -fno-eliminate-unused-debug-symbols" }
 // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
 // { dg-final { scan-assembler "tv_sec.*DW_AT_name" } }
 // { dg-final { scan-assembler "tv_nsec.*DW_AT_name" } }
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-sys.c b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-sys.c
index ad0a44a95b3..9c100d7cf91 100644
--- a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-sys.c
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-sys.c
@@ -1,5 +1,5 @@
 // { dg-do compile }
-// { dg-options "-gdwarf -dA -femit-struct-debug-detailed=sys" }
+// { dg-options "-gdwarf -dA -femit-struct-debug-detailed=sys -fno-eliminate-unused-debug-symbols" }
 // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
 // { dg-final { scan-assembler "tv_sec.*DW_AT_name" } }
 // { dg-final { scan-assembler "tv_nsec.*DW_AT_name" } }
--
2.21.0

Reply | Threaded
Open this post in threaded view
|

Re: [PATCHv2] debug: make -feliminate-unused-debug-symbols the default [PR debug/86964]

Thomas De Schampheleire
Hi Richard,

El mar., 21 may. 2019 a las 16:57, Thomas De Schampheleire
(<[hidden email]>) escribió:

>
> From: Thomas De Schampheleire <[hidden email]>
>
> In addition to making -feliminate-unused-debug-symbols work for the DWARF
> format (see [1]), make this option the default. This behavior was the case
> before, e.g. under gcc 4.9.x.
> [1] https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=269925
>
> This change requires some updates to test cases, which expected the previous
> default of not eliminating unused debug symbols.
>
> gcc/ChangeLog:
>
> 2019-05-21  Thomas De Schampheleire  <[hidden email]>
>
>         PR debug/86964
>         * common.opt (feliminate-unused-debug-symbols): Enable by default.
>         * doc/invoke.texi (Debugging Options): Document new default of
>         -feliminate-unused-debug-symbols and remove restriction to 'stabs'.
>
> gcc/testsuite/ChangeLog:
>
> 2019-05-21  Thomas De Schampheleire  <[hidden email]>
>
>         PR debug/86964
>         * g++.dg/debug/dwarf2/fesd-any.C: Use
>         -fno-eliminate-unused-debug-symbols.
>         * g++.dg/debug/dwarf2/fesd-baseonly.C: Likewise.
>         * g++.dg/debug/dwarf2/fesd-none.C: Likewise.
>         * g++.dg/debug/dwarf2/fesd-reduced.C: Likewise.
>         * g++.dg/debug/dwarf2/fesd-sys.C: Likewise.
>         * g++.dg/debug/dwarf2/inline-var-1.C: Likewise.
>         * g++.dg/debug/enum-2.C: Likewise.
>         * gcc.dg/debug/dwarf2/fesd-any.c: Likewise.
>         * gcc.dg/debug/dwarf2/fesd-baseonly.c: Likewise.
>         * gcc.dg/debug/dwarf2/fesd-none.c: Likewise.
>         * gcc.dg/debug/dwarf2/fesd-reduced.c: Likewise.
>         * gcc.dg/debug/dwarf2/fesd-sys.c: Likewise.
> ---
>  gcc/common.opt                                    | 2 +-
>  gcc/doc/invoke.texi                               | 9 +++++----
>  gcc/testsuite/g++.dg/debug/dwarf2/fesd-any.C      | 2 +-
>  gcc/testsuite/g++.dg/debug/dwarf2/fesd-baseonly.C | 2 +-
>  gcc/testsuite/g++.dg/debug/dwarf2/fesd-none.C     | 2 +-
>  gcc/testsuite/g++.dg/debug/dwarf2/fesd-reduced.C  | 2 +-
>  gcc/testsuite/g++.dg/debug/dwarf2/fesd-sys.C      | 2 +-
>  gcc/testsuite/g++.dg/debug/dwarf2/inline-var-1.C  | 2 +-
>  gcc/testsuite/g++.dg/debug/enum-2.C               | 1 +
>  gcc/testsuite/gcc.dg/debug/dwarf2/fesd-any.c      | 2 +-
>  gcc/testsuite/gcc.dg/debug/dwarf2/fesd-baseonly.c | 2 +-
>  gcc/testsuite/gcc.dg/debug/dwarf2/fesd-none.c     | 2 +-
>  gcc/testsuite/gcc.dg/debug/dwarf2/fesd-reduced.c  | 2 +-
>  gcc/testsuite/gcc.dg/debug/dwarf2/fesd-sys.c      | 2 +-
>  14 files changed, 18 insertions(+), 16 deletions(-)
>
> diff --git a/gcc/common.opt b/gcc/common.opt
> index d342c4f3749..0e72fd08ec4 100644
> --- a/gcc/common.opt
> +++ b/gcc/common.opt
> @@ -1379,7 +1379,7 @@ Common Report Var(flag_ipa_sra) Init(0) Optimization
>  Perform interprocedural reduction of aggregates.
>
>  feliminate-unused-debug-symbols
> -Common Report Var(flag_debug_only_used_symbols)
> +Common Report Var(flag_debug_only_used_symbols) Init(1)
>  Perform unused symbol elimination in debug info.
>
>  feliminate-unused-debug-types
> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
> index 5e3e8873d35..06c8c60f19e 100644
> --- a/gcc/doc/invoke.texi
> +++ b/gcc/doc/invoke.texi
> @@ -388,7 +388,7 @@ Objective-C and Objective-C++ Dialects}.
>  -fno-eliminate-unused-debug-types @gol
>  -femit-struct-debug-baseonly  -femit-struct-debug-reduced @gol
>  -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
> --feliminate-unused-debug-symbols  -femit-class-debug-always @gol
> +-fno-eliminate-unused-debug-symbols  -femit-class-debug-always @gol
>  -fno-merge-debug-strings  -fno-dwarf2-cfi-asm @gol
>  -fvar-tracking  -fvar-tracking-assignments}
>
> @@ -7827,10 +7827,11 @@ confusion with @option{-gdwarf-@var{level}}.
>  Instead use an additional @option{-g@var{level}} option to change the
>  debug level for DWARF.
>
> -@item -feliminate-unused-debug-symbols
> +@item -fno-eliminate-unused-debug-symbols
>  @opindex feliminate-unused-debug-symbols
> -Produce debugging information in stabs format (if that is supported),
> -for only symbols that are actually used.
> +@opindex fno-eliminate-unused-debug-symbols
> +By default, no debug information is produced for symbols that are not actually
> +used. Use this option if you want debug information for all symbols.
>
>  @item -femit-class-debug-always
>  @opindex femit-class-debug-always
> diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-any.C b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-any.C
> index a4a0b50ee50..5868ebc9c85 100644
> --- a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-any.C
> +++ b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-any.C
> @@ -1,5 +1,5 @@
>  // { dg-do compile }
> -// { dg-options "-gdwarf-2 -dA -femit-struct-debug-detailed=any" }
> +// { dg-options "-gdwarf-2 -dA -femit-struct-debug-detailed=any -fno-eliminate-unused-debug-symbols" }
>  // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
>  // { dg-final { scan-assembler "tv_sec.*DW_AT_name" } }
>  // { dg-final { scan-assembler "tv_nsec.*DW_AT_name" } }
> diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-baseonly.C b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-baseonly.C
> index 4f580ebd361..fe0016a4563 100644
> --- a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-baseonly.C
> +++ b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-baseonly.C
> @@ -1,5 +1,5 @@
>  // { dg-do compile }
> -// { dg-options "-gdwarf-2 -dA -femit-struct-debug-baseonly" }
> +// { dg-options "-gdwarf-2 -dA -femit-struct-debug-baseonly -fno-eliminate-unused-debug-symbols" }
>  // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
>  // { dg-final { scan-assembler-not "tv_sec.*DW_AT_name" } }
>  // { dg-final { scan-assembler-not "tv_nsec.*DW_AT_name" } }
> diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-none.C b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-none.C
> index 0af0a83d85f..c5a33967426 100644
> --- a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-none.C
> +++ b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-none.C
> @@ -1,5 +1,5 @@
>  // { dg-do compile }
> -// { dg-options "-gdwarf-2 -dA -femit-struct-debug-detailed=none" }
> +// { dg-options "-gdwarf-2 -dA -femit-struct-debug-detailed=none -fno-eliminate-unused-debug-symbols" }
>  // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
>  // { dg-final { scan-assembler-not "tv_sec.*DW_AT_name" } }
>  // { dg-final { scan-assembler-not "tv_nsec.*DW_AT_name" } }
> diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-reduced.C b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-reduced.C
> index a93b90f05ad..ba40f176375 100644
> --- a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-reduced.C
> +++ b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-reduced.C
> @@ -1,5 +1,5 @@
>  // { dg-do compile }
> -// { dg-options "-gdwarf-2 -dA -femit-struct-debug-reduced" }
> +// { dg-options "-gdwarf-2 -dA -femit-struct-debug-reduced -fno-eliminate-unused-debug-symbols" }
>  // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
>  // { dg-final { scan-assembler "tv_sec.*DW_AT_name" } }
>  // { dg-final { scan-assembler "tv_nsec.*DW_AT_name" } }
> diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-sys.C b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-sys.C
> index 95a9a31ff60..86eeb21cf10 100644
> --- a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-sys.C
> +++ b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-sys.C
> @@ -1,5 +1,5 @@
>  // { dg-do compile }
> -// { dg-options "-gdwarf-2 -dA -femit-struct-debug-detailed=sys" }
> +// { dg-options "-gdwarf-2 -dA -femit-struct-debug-detailed=sys -fno-eliminate-unused-debug-symbols" }
>  // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
>  // { dg-final { scan-assembler "tv_sec.*DW_AT_name" } }
>  // { dg-final { scan-assembler "tv_nsec.*DW_AT_name" } }
> diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/inline-var-1.C b/gcc/testsuite/g++.dg/debug/dwarf2/inline-var-1.C
> index fc3e6fd435f..3b1c913edfc 100644
> --- a/gcc/testsuite/g++.dg/debug/dwarf2/inline-var-1.C
> +++ b/gcc/testsuite/g++.dg/debug/dwarf2/inline-var-1.C
> @@ -1,5 +1,5 @@
>  // { dg-do compile { target c++17 } }
> -// { dg-options "-O -g -dA -gno-strict-dwarf" }
> +// { dg-options "-O -g -dA -gno-strict-dwarf -fno-eliminate-unused-debug-symbols" }
>  // { dg-require-weak "" }
>  // { dg-final { scan-assembler-times "0x3\[^\n\r]* DW_AT_inline" 6 { xfail *-*-aix* } } }
>  // { dg-final { scan-assembler-times "0x1\[^\n\r]* DW_AT_inline" 2 { xfail *-*-aix* } } }
> diff --git a/gcc/testsuite/g++.dg/debug/enum-2.C b/gcc/testsuite/g++.dg/debug/enum-2.C
> index d5501313d93..554de37c40a 100644
> --- a/gcc/testsuite/g++.dg/debug/enum-2.C
> +++ b/gcc/testsuite/g++.dg/debug/enum-2.C
> @@ -1,5 +1,6 @@
>  /* Verify that used enums are output.  */
>  /* { dg-do compile } */
> +/* { dg-options "-fno-eliminate-unused-debug-symbols" } */
>  /* { dg-final { scan-assembler "JTI_MAX" } } */
>
>  int var;
> diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-any.c b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-any.c
> index 810788ae6e3..4062268e54c 100644
> --- a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-any.c
> +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-any.c
> @@ -1,5 +1,5 @@
>  // { dg-do compile }
> -// { dg-options "-gdwarf -dA -femit-struct-debug-detailed=any" }
> +// { dg-options "-gdwarf -dA -femit-struct-debug-detailed=any -fno-eliminate-unused-debug-symbols" }
>  // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
>  // { dg-final { scan-assembler "tv_sec.*DW_AT_name" } }
>  // { dg-final { scan-assembler "tv_nsec.*DW_AT_name" } }
> diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-baseonly.c b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-baseonly.c
> index aefcb871509..fffdf04cfb6 100644
> --- a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-baseonly.c
> +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-baseonly.c
> @@ -1,5 +1,5 @@
>  // { dg-do compile }
> -// { dg-options "-gdwarf -dA -femit-struct-debug-baseonly" }
> +// { dg-options "-gdwarf -dA -femit-struct-debug-baseonly -fno-eliminate-unused-debug-symbols" }
>  // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
>  // { dg-final { scan-assembler-not "tv_sec.*DW_AT_name" } }
>  // { dg-final { scan-assembler-not "tv_nsec.*DW_AT_name" } }
> diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-none.c b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-none.c
> index 193c05d6155..6fba51287ef 100644
> --- a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-none.c
> +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-none.c
> @@ -1,5 +1,5 @@
>  // { dg-do compile }
> -// { dg-options "-gdwarf -dA -femit-struct-debug-detailed=none" }
> +// { dg-options "-gdwarf -dA -femit-struct-debug-detailed=none -fno-eliminate-unused-debug-symbols" }
>  // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
>  // { dg-final { scan-assembler-not "tv_sec.*DW_AT_name" } }
>  // { dg-final { scan-assembler-not "tv_nsec.*DW_AT_name" } }
> diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-reduced.c b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-reduced.c
> index ebbfc36672b..4209e30e3f9 100644
> --- a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-reduced.c
> +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-reduced.c
> @@ -1,5 +1,5 @@
>  // { dg-do compile }
> -// { dg-options "-gdwarf -dA -femit-struct-debug-reduced" }
> +// { dg-options "-gdwarf -dA -femit-struct-debug-reduced -fno-eliminate-unused-debug-symbols" }
>  // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
>  // { dg-final { scan-assembler "tv_sec.*DW_AT_name" } }
>  // { dg-final { scan-assembler "tv_nsec.*DW_AT_name" } }
> diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-sys.c b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-sys.c
> index ad0a44a95b3..9c100d7cf91 100644
> --- a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-sys.c
> +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-sys.c
> @@ -1,5 +1,5 @@
>  // { dg-do compile }
> -// { dg-options "-gdwarf -dA -femit-struct-debug-detailed=sys" }
> +// { dg-options "-gdwarf -dA -femit-struct-debug-detailed=sys -fno-eliminate-unused-debug-symbols" }
>  // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
>  // { dg-final { scan-assembler "tv_sec.*DW_AT_name" } }
>  // { dg-final { scan-assembler "tv_nsec.*DW_AT_name" } }
> --


Does this patch look better to you?

Thanks,
Thomas
Reply | Threaded
Open this post in threaded view
|

Re: [PATCHv2] debug: make -feliminate-unused-debug-symbols the default [PR debug/86964]

Richard Biener-2
On Wed, May 29, 2019 at 12:10 PM Thomas De Schampheleire
<[hidden email]> wrote:
>
> Hi Richard,

Sorry for the delay - I have bootstrapped/tested the patch and
installed it on trunk.
If there will be no complaints I plan to backport it for GCC 9.2 (you
may need to
remind me in a few weeks).

Thanks again,
Richard.

> El mar., 21 may. 2019 a las 16:57, Thomas De Schampheleire
> (<[hidden email]>) escribió:
> >
> > From: Thomas De Schampheleire <[hidden email]>
> >
> > In addition to making -feliminate-unused-debug-symbols work for the DWARF
> > format (see [1]), make this option the default. This behavior was the case
> > before, e.g. under gcc 4.9.x.
> > [1] https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=269925
> >
> > This change requires some updates to test cases, which expected the previous
> > default of not eliminating unused debug symbols.
> >
> > gcc/ChangeLog:
> >
> > 2019-05-21  Thomas De Schampheleire  <[hidden email]>
> >
> >         PR debug/86964
> >         * common.opt (feliminate-unused-debug-symbols): Enable by default.
> >         * doc/invoke.texi (Debugging Options): Document new default of
> >         -feliminate-unused-debug-symbols and remove restriction to 'stabs'.
> >
> > gcc/testsuite/ChangeLog:
> >
> > 2019-05-21  Thomas De Schampheleire  <[hidden email]>
> >
> >         PR debug/86964
> >         * g++.dg/debug/dwarf2/fesd-any.C: Use
> >         -fno-eliminate-unused-debug-symbols.
> >         * g++.dg/debug/dwarf2/fesd-baseonly.C: Likewise.
> >         * g++.dg/debug/dwarf2/fesd-none.C: Likewise.
> >         * g++.dg/debug/dwarf2/fesd-reduced.C: Likewise.
> >         * g++.dg/debug/dwarf2/fesd-sys.C: Likewise.
> >         * g++.dg/debug/dwarf2/inline-var-1.C: Likewise.
> >         * g++.dg/debug/enum-2.C: Likewise.
> >         * gcc.dg/debug/dwarf2/fesd-any.c: Likewise.
> >         * gcc.dg/debug/dwarf2/fesd-baseonly.c: Likewise.
> >         * gcc.dg/debug/dwarf2/fesd-none.c: Likewise.
> >         * gcc.dg/debug/dwarf2/fesd-reduced.c: Likewise.
> >         * gcc.dg/debug/dwarf2/fesd-sys.c: Likewise.
> > ---
> >  gcc/common.opt                                    | 2 +-
> >  gcc/doc/invoke.texi                               | 9 +++++----
> >  gcc/testsuite/g++.dg/debug/dwarf2/fesd-any.C      | 2 +-
> >  gcc/testsuite/g++.dg/debug/dwarf2/fesd-baseonly.C | 2 +-
> >  gcc/testsuite/g++.dg/debug/dwarf2/fesd-none.C     | 2 +-
> >  gcc/testsuite/g++.dg/debug/dwarf2/fesd-reduced.C  | 2 +-
> >  gcc/testsuite/g++.dg/debug/dwarf2/fesd-sys.C      | 2 +-
> >  gcc/testsuite/g++.dg/debug/dwarf2/inline-var-1.C  | 2 +-
> >  gcc/testsuite/g++.dg/debug/enum-2.C               | 1 +
> >  gcc/testsuite/gcc.dg/debug/dwarf2/fesd-any.c      | 2 +-
> >  gcc/testsuite/gcc.dg/debug/dwarf2/fesd-baseonly.c | 2 +-
> >  gcc/testsuite/gcc.dg/debug/dwarf2/fesd-none.c     | 2 +-
> >  gcc/testsuite/gcc.dg/debug/dwarf2/fesd-reduced.c  | 2 +-
> >  gcc/testsuite/gcc.dg/debug/dwarf2/fesd-sys.c      | 2 +-
> >  14 files changed, 18 insertions(+), 16 deletions(-)
> >
> > diff --git a/gcc/common.opt b/gcc/common.opt
> > index d342c4f3749..0e72fd08ec4 100644
> > --- a/gcc/common.opt
> > +++ b/gcc/common.opt
> > @@ -1379,7 +1379,7 @@ Common Report Var(flag_ipa_sra) Init(0) Optimization
> >  Perform interprocedural reduction of aggregates.
> >
> >  feliminate-unused-debug-symbols
> > -Common Report Var(flag_debug_only_used_symbols)
> > +Common Report Var(flag_debug_only_used_symbols) Init(1)
> >  Perform unused symbol elimination in debug info.
> >
> >  feliminate-unused-debug-types
> > diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
> > index 5e3e8873d35..06c8c60f19e 100644
> > --- a/gcc/doc/invoke.texi
> > +++ b/gcc/doc/invoke.texi
> > @@ -388,7 +388,7 @@ Objective-C and Objective-C++ Dialects}.
> >  -fno-eliminate-unused-debug-types @gol
> >  -femit-struct-debug-baseonly  -femit-struct-debug-reduced @gol
> >  -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
> > --feliminate-unused-debug-symbols  -femit-class-debug-always @gol
> > +-fno-eliminate-unused-debug-symbols  -femit-class-debug-always @gol
> >  -fno-merge-debug-strings  -fno-dwarf2-cfi-asm @gol
> >  -fvar-tracking  -fvar-tracking-assignments}
> >
> > @@ -7827,10 +7827,11 @@ confusion with @option{-gdwarf-@var{level}}.
> >  Instead use an additional @option{-g@var{level}} option to change the
> >  debug level for DWARF.
> >
> > -@item -feliminate-unused-debug-symbols
> > +@item -fno-eliminate-unused-debug-symbols
> >  @opindex feliminate-unused-debug-symbols
> > -Produce debugging information in stabs format (if that is supported),
> > -for only symbols that are actually used.
> > +@opindex fno-eliminate-unused-debug-symbols
> > +By default, no debug information is produced for symbols that are not actually
> > +used. Use this option if you want debug information for all symbols.
> >
> >  @item -femit-class-debug-always
> >  @opindex femit-class-debug-always
> > diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-any.C b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-any.C
> > index a4a0b50ee50..5868ebc9c85 100644
> > --- a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-any.C
> > +++ b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-any.C
> > @@ -1,5 +1,5 @@
> >  // { dg-do compile }
> > -// { dg-options "-gdwarf-2 -dA -femit-struct-debug-detailed=any" }
> > +// { dg-options "-gdwarf-2 -dA -femit-struct-debug-detailed=any -fno-eliminate-unused-debug-symbols" }
> >  // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
> >  // { dg-final { scan-assembler "tv_sec.*DW_AT_name" } }
> >  // { dg-final { scan-assembler "tv_nsec.*DW_AT_name" } }
> > diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-baseonly.C b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-baseonly.C
> > index 4f580ebd361..fe0016a4563 100644
> > --- a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-baseonly.C
> > +++ b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-baseonly.C
> > @@ -1,5 +1,5 @@
> >  // { dg-do compile }
> > -// { dg-options "-gdwarf-2 -dA -femit-struct-debug-baseonly" }
> > +// { dg-options "-gdwarf-2 -dA -femit-struct-debug-baseonly -fno-eliminate-unused-debug-symbols" }
> >  // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
> >  // { dg-final { scan-assembler-not "tv_sec.*DW_AT_name" } }
> >  // { dg-final { scan-assembler-not "tv_nsec.*DW_AT_name" } }
> > diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-none.C b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-none.C
> > index 0af0a83d85f..c5a33967426 100644
> > --- a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-none.C
> > +++ b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-none.C
> > @@ -1,5 +1,5 @@
> >  // { dg-do compile }
> > -// { dg-options "-gdwarf-2 -dA -femit-struct-debug-detailed=none" }
> > +// { dg-options "-gdwarf-2 -dA -femit-struct-debug-detailed=none -fno-eliminate-unused-debug-symbols" }
> >  // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
> >  // { dg-final { scan-assembler-not "tv_sec.*DW_AT_name" } }
> >  // { dg-final { scan-assembler-not "tv_nsec.*DW_AT_name" } }
> > diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-reduced.C b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-reduced.C
> > index a93b90f05ad..ba40f176375 100644
> > --- a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-reduced.C
> > +++ b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-reduced.C
> > @@ -1,5 +1,5 @@
> >  // { dg-do compile }
> > -// { dg-options "-gdwarf-2 -dA -femit-struct-debug-reduced" }
> > +// { dg-options "-gdwarf-2 -dA -femit-struct-debug-reduced -fno-eliminate-unused-debug-symbols" }
> >  // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
> >  // { dg-final { scan-assembler "tv_sec.*DW_AT_name" } }
> >  // { dg-final { scan-assembler "tv_nsec.*DW_AT_name" } }
> > diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-sys.C b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-sys.C
> > index 95a9a31ff60..86eeb21cf10 100644
> > --- a/gcc/testsuite/g++.dg/debug/dwarf2/fesd-sys.C
> > +++ b/gcc/testsuite/g++.dg/debug/dwarf2/fesd-sys.C
> > @@ -1,5 +1,5 @@
> >  // { dg-do compile }
> > -// { dg-options "-gdwarf-2 -dA -femit-struct-debug-detailed=sys" }
> > +// { dg-options "-gdwarf-2 -dA -femit-struct-debug-detailed=sys -fno-eliminate-unused-debug-symbols" }
> >  // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
> >  // { dg-final { scan-assembler "tv_sec.*DW_AT_name" } }
> >  // { dg-final { scan-assembler "tv_nsec.*DW_AT_name" } }
> > diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/inline-var-1.C b/gcc/testsuite/g++.dg/debug/dwarf2/inline-var-1.C
> > index fc3e6fd435f..3b1c913edfc 100644
> > --- a/gcc/testsuite/g++.dg/debug/dwarf2/inline-var-1.C
> > +++ b/gcc/testsuite/g++.dg/debug/dwarf2/inline-var-1.C
> > @@ -1,5 +1,5 @@
> >  // { dg-do compile { target c++17 } }
> > -// { dg-options "-O -g -dA -gno-strict-dwarf" }
> > +// { dg-options "-O -g -dA -gno-strict-dwarf -fno-eliminate-unused-debug-symbols" }
> >  // { dg-require-weak "" }
> >  // { dg-final { scan-assembler-times "0x3\[^\n\r]* DW_AT_inline" 6 { xfail *-*-aix* } } }
> >  // { dg-final { scan-assembler-times "0x1\[^\n\r]* DW_AT_inline" 2 { xfail *-*-aix* } } }
> > diff --git a/gcc/testsuite/g++.dg/debug/enum-2.C b/gcc/testsuite/g++.dg/debug/enum-2.C
> > index d5501313d93..554de37c40a 100644
> > --- a/gcc/testsuite/g++.dg/debug/enum-2.C
> > +++ b/gcc/testsuite/g++.dg/debug/enum-2.C
> > @@ -1,5 +1,6 @@
> >  /* Verify that used enums are output.  */
> >  /* { dg-do compile } */
> > +/* { dg-options "-fno-eliminate-unused-debug-symbols" } */
> >  /* { dg-final { scan-assembler "JTI_MAX" } } */
> >
> >  int var;
> > diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-any.c b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-any.c
> > index 810788ae6e3..4062268e54c 100644
> > --- a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-any.c
> > +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-any.c
> > @@ -1,5 +1,5 @@
> >  // { dg-do compile }
> > -// { dg-options "-gdwarf -dA -femit-struct-debug-detailed=any" }
> > +// { dg-options "-gdwarf -dA -femit-struct-debug-detailed=any -fno-eliminate-unused-debug-symbols" }
> >  // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
> >  // { dg-final { scan-assembler "tv_sec.*DW_AT_name" } }
> >  // { dg-final { scan-assembler "tv_nsec.*DW_AT_name" } }
> > diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-baseonly.c b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-baseonly.c
> > index aefcb871509..fffdf04cfb6 100644
> > --- a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-baseonly.c
> > +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-baseonly.c
> > @@ -1,5 +1,5 @@
> >  // { dg-do compile }
> > -// { dg-options "-gdwarf -dA -femit-struct-debug-baseonly" }
> > +// { dg-options "-gdwarf -dA -femit-struct-debug-baseonly -fno-eliminate-unused-debug-symbols" }
> >  // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
> >  // { dg-final { scan-assembler-not "tv_sec.*DW_AT_name" } }
> >  // { dg-final { scan-assembler-not "tv_nsec.*DW_AT_name" } }
> > diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-none.c b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-none.c
> > index 193c05d6155..6fba51287ef 100644
> > --- a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-none.c
> > +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-none.c
> > @@ -1,5 +1,5 @@
> >  // { dg-do compile }
> > -// { dg-options "-gdwarf -dA -femit-struct-debug-detailed=none" }
> > +// { dg-options "-gdwarf -dA -femit-struct-debug-detailed=none -fno-eliminate-unused-debug-symbols" }
> >  // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
> >  // { dg-final { scan-assembler-not "tv_sec.*DW_AT_name" } }
> >  // { dg-final { scan-assembler-not "tv_nsec.*DW_AT_name" } }
> > diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-reduced.c b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-reduced.c
> > index ebbfc36672b..4209e30e3f9 100644
> > --- a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-reduced.c
> > +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-reduced.c
> > @@ -1,5 +1,5 @@
> >  // { dg-do compile }
> > -// { dg-options "-gdwarf -dA -femit-struct-debug-reduced" }
> > +// { dg-options "-gdwarf -dA -femit-struct-debug-reduced -fno-eliminate-unused-debug-symbols" }
> >  // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
> >  // { dg-final { scan-assembler "tv_sec.*DW_AT_name" } }
> >  // { dg-final { scan-assembler "tv_nsec.*DW_AT_name" } }
> > diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-sys.c b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-sys.c
> > index ad0a44a95b3..9c100d7cf91 100644
> > --- a/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-sys.c
> > +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/fesd-sys.c
> > @@ -1,5 +1,5 @@
> >  // { dg-do compile }
> > -// { dg-options "-gdwarf -dA -femit-struct-debug-detailed=sys" }
> > +// { dg-options "-gdwarf -dA -femit-struct-debug-detailed=sys -fno-eliminate-unused-debug-symbols" }
> >  // { dg-final { scan-assembler "timespec.*DW_AT_name" } }
> >  // { dg-final { scan-assembler "tv_sec.*DW_AT_name" } }
> >  // { dg-final { scan-assembler "tv_nsec.*DW_AT_name" } }
> > --
>
>
> Does this patch look better to you?
>
> Thanks,
> Thomas
Reply | Threaded
Open this post in threaded view
|

Re: [PATCHv2] debug: make -feliminate-unused-debug-symbols the default [PR debug/86964]

Thomas De Schampheleire
On Fri, May 31, 2019, 10:23 Richard Biener <[hidden email]>
wrote:

> On Wed, May 29, 2019 at 12:10 PM Thomas De Schampheleire
> <[hidden email]> wrote:
> >
> > Hi Richard,
>
> Sorry for the delay - I have bootstrapped/tested the patch and
> installed it on trunk.
> If there will be no complaints I plan to backport it for GCC 9.2 (you
> may need to
> remind me in a few weeks).
>

Thanks.

I think I read somewhere that 7.4 is the last 7.x release, is that correct?

But what about 8.x? If there will be a new release I think these patches
should be backported too, no? After all, it's part of a regression.

In what location can you see such info about which branches and releases
are expected, latest release in a stream, etc?

Best regards
Thomas
Reply | Threaded
Open this post in threaded view
|

Re: [PATCHv2] debug: make -feliminate-unused-debug-symbols the default [PR debug/86964]

Richard Biener-2
On Fri, May 31, 2019 at 10:39 AM Thomas De Schampheleire
<[hidden email]> wrote:

>
>
>
> On Fri, May 31, 2019, 10:23 Richard Biener <[hidden email]> wrote:
>>
>> On Wed, May 29, 2019 at 12:10 PM Thomas De Schampheleire
>> <[hidden email]> wrote:
>> >
>> > Hi Richard,
>>
>> Sorry for the delay - I have bootstrapped/tested the patch and
>> installed it on trunk.
>> If there will be no complaints I plan to backport it for GCC 9.2 (you
>> may need to
>> remind me in a few weeks).
>
>
> Thanks.
>
> I think I read somewhere that 7.4 is the last 7.x release, is that correct?
>
> But what about 8.x? If there will be a new release I think these patches should be backported too, no? After all, it's part of a regression.

I'm not opposed to that but would like to see feedback first - too bad
we missed making this the default for GCC 9.1.

> In what location can you see such info about which branches and releases are expected, latest release in a stream, etc?

There's only the toplevel https://gcc.gnu.org/ page which lists active
branches.  That the next release from the 7 branch will be
the last is not documented anywhere.

Richard.

> Best regards
> Thomas