+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
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
-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}
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
+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
// { 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" } }
// { 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" } }
// { 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" } }
// { 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" } }
// { 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" } }
// { 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* } } }
/* Verify that used enums are output. */
/* { dg-do compile } */
+/* { dg-options "-fno-eliminate-unused-debug-symbols" } */
/* { dg-final { scan-assembler "JTI_MAX" } } */
int var;
// { 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" } }
// { 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" } }
// { 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" } }
// { 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" } }
// { 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" } }