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

Thomas De Schampheleire patrickdepinguin@gmail.com
Thu May 16 09:20:00 GMT 2019


From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>

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

gcc/ChangeLog:

2019-05-16  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'.
---
 gcc/common.opt      | 2 +-
 gcc/doc/invoke.texi | 9 +++++----
 2 files changed, 6 insertions(+), 5 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
-- 
2.21.0



More information about the Gcc-patches mailing list