From: Richard Biener Date: Fri, 27 Mar 2020 12:57:42 +0000 (+0100) Subject: debug/94273 - avoid creating type DIEs for DINFO_LEVEL_TERSE X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=45cfaf9903d3f5aa916d330f2013eb7d820a7137;p=gcc.git 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. --- 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;