re PR debug/86964 (Too many debug symbols included, especially for extern globals)
authorThomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Fri, 31 May 2019 08:22:14 +0000 (08:22 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 31 May 2019 08:22:14 +0000 (08:22 +0000)
2019-05-31  Thomas De Schampheleire  <thomas.de_schampheleire@nokia.com>

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'.

* 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.

From-SVN: r271803

16 files changed:
gcc/ChangeLog
gcc/common.opt
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/debug/dwarf2/fesd-any.C
gcc/testsuite/g++.dg/debug/dwarf2/fesd-baseonly.C
gcc/testsuite/g++.dg/debug/dwarf2/fesd-none.C
gcc/testsuite/g++.dg/debug/dwarf2/fesd-reduced.C
gcc/testsuite/g++.dg/debug/dwarf2/fesd-sys.C
gcc/testsuite/g++.dg/debug/dwarf2/inline-var-1.C
gcc/testsuite/g++.dg/debug/enum-2.C
gcc/testsuite/gcc.dg/debug/dwarf2/fesd-any.c
gcc/testsuite/gcc.dg/debug/dwarf2/fesd-baseonly.c
gcc/testsuite/gcc.dg/debug/dwarf2/fesd-none.c
gcc/testsuite/gcc.dg/debug/dwarf2/fesd-reduced.c
gcc/testsuite/gcc.dg/debug/dwarf2/fesd-sys.c

index 5283feda9d55a185eda23ea105d9cbf6806dab81..b275f01b541895610f57c31db397045e1b8341d0 100644 (file)
@@ -1,3 +1,10 @@
+2019-05-31  Thomas De Schampheleire  <thomas.de_schampheleire@nokia.com>
+
+       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'.
+
 2019-05-31  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/90671
index d342c4f3749a39df086236162636f14f91bcd8a0..0e72fd08ec46b4cf649435442e22394a27e65cb2 100644 (file)
@@ -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
index 3e4f012b4fa47f5bbcac6e44542e51b601d8a968..9e2fab5098ff81c493e529e07c8164e2326429ad 100644 (file)
@@ -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}
 
@@ -7828,10 +7828,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
index c081448df40feaa670103784fabb1a0b11ef69b0..b2f4478126d7d1a4521c1953692e96919297eda0 100644 (file)
@@ -1,3 +1,20 @@
+2019-05-31  Thomas De Schampheleire  <thomas.de_schampheleire@nokia.com>
+
+       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.
+
 2019-05-31  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/90671
index a4a0b50ee50bc673a588a6822a65f6d9a3f73336..5868ebc9c85eb488071d8467d176db10df9b63cd 100644 (file)
@@ -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" } }
index 4f580ebd36120a8b2b2ff331c767d259e50d011e..fe0016a45638f7b3d615442b7969ce7dcaf7efa8 100644 (file)
@@ -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" } }
index 0af0a83d85f73151a83cd97617a4a6bf2b523a5e..c5a33967426c1996a901ed672ab651a474263aae 100644 (file)
@@ -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" } }
index a93b90f05adf159a7ac45b22630e737b8dede6ca..ba40f1763755a97215a2add03cad1374e3785aa8 100644 (file)
@@ -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" } }
index 95a9a31ff609d7e3e823cb93d76de84fd928f4db..86eeb21cf104da0feb5b82277753ec27011826ec 100644 (file)
@@ -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" } }
index fc3e6fd435f45627722f583339d01d4efb395310..3b1c913edfca779e244c7fc121e4e6ffb9140b2b 100644 (file)
@@ -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* } } }
index d5501313d9300aa401cb00068271155d37d75325..554de37c40a2535e6fd22b7a27b00328c0c21e7c 100644 (file)
@@ -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;
index 810788ae6e30a41c70f5c0a85ad3a1bc9f3f7a6d..4062268e54c3d2fda99f5513b2f70a2988367494 100644 (file)
@@ -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" } }
index aefcb871509b34ad1fd94d9c36eb7b292d0989c4..fffdf04cfb6ea22cbb754689b3399e082b1fcfb1 100644 (file)
@@ -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" } }
index 193c05d6155cc35a5380f364785938efc7b4cccb..6fba51287efa84bac8cedc0b5610d87ba2d30a89 100644 (file)
@@ -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" } }
index ebbfc36672b0c0c1de47f60ed31089ce8db341c6..4209e30e3f934d86a691b2f3fdf3e644cbbaecb1 100644 (file)
@@ -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" } }
index ad0a44a95b32069af57869d5c557c33f3303479e..9c100d7cf918466ff76cfc2c8793d3c25e0366bb 100644 (file)
@@ -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" } }