From 45cfaf9903d3f5aa916d330f2013eb7d820a7137 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Fri, 27 Mar 2020 13:57:42 +0100 Subject: [PATCH] debug/94273 - avoid creating type DIEs for DINFO_LEVEL_TERSE This avoids completing types for DINFO_LEVEL_TERSE by using the should_emit_struct_debug machinery. 2020-03-27 Richard Biener PR debug/94273 * dwarf2out.c (should_emit_struct_debug): Return false for DINFO_LEVEL_TERSE. * g++.dg/debug/pr94273.C: New testcase. --- gcc/ChangeLog | 6 ++++++ gcc/dwarf2out.c | 3 +++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/debug/pr94273.C | 4 ++++ 4 files changed, 18 insertions(+) create mode 100644 gcc/testsuite/g++.dg/debug/pr94273.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 97cad024271..ef8dffbbf1e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2020-03-27 Richard Biener + + PR debug/94273 + * dwarf2out.c (should_emit_struct_debug): Return false for + DINFO_LEVEL_TERSE. + 2020-03-27 Richard Biener PR tree-optimization/94352 diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index b1fa6f5ff7c..378a27394e8 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -399,6 +399,9 @@ get_full_len (const wide_int &op) static bool should_emit_struct_debug (tree type, enum debug_info_usage usage) { + if (debug_info_level <= DINFO_LEVEL_TERSE) + return false; + enum debug_struct_file criterion; tree type_decl; bool generic = lang_hooks.types.generic_p (type); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d5a1c8e1a8e..156eee12cdd 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2020-03-27 Richard Biener + + PR debug/94273 + * g++.dg/debug/pr94273.C: New testcase. + 2020-03-27 Tobias Burnus PR fortran/93957 diff --git a/gcc/testsuite/g++.dg/debug/pr94273.C b/gcc/testsuite/g++.dg/debug/pr94273.C new file mode 100644 index 00000000000..4e5c66d8e26 --- /dev/null +++ b/gcc/testsuite/g++.dg/debug/pr94273.C @@ -0,0 +1,4 @@ +class a { + virtual void c() {} +} extern b; +a b; -- 2.30.2