Message ID | 20160818093323.31600-1-derodat@adacore.com |
---|---|
State | New |
Headers | show |
On 08/18/2016 03:33 AM, Pierre-Marie de Rodat wrote: > Hello, > > A check in dwarf2out_imported_module_or_decl prevents valid strict > DWARF2 constructs such as DW_TAG_imported_declaration from being emitted > in dwarf2out_imported_module_or_decl_1. > > The latter already protects the emission of newer DWARF tags with > appropriate checks, so the one in the former is redundant and > pessimistic. This function is already called from places like > process_scope_var, which are not protected anyway. > > This patch removes the check in dwarf2out_imported_module_or_decl so > that tags like DW_TAG_imported_declaration are emitted even in strict > DWARF2 mode. > > Bootstrapped and regtested on x86_64-linux, no regression. I also > checked that the new testcase fails on mainline. Ok to commit? > Thank you in advance! > > gcc/ > > * dwarf2out.c (dwarf2out_imported_module_or_decl): Remove > pessimistic DWARF version check. > > gcc/testsuite/ > > * gnat.dg/debug7.adb, gnat.dg/debug7.ads: New testcase. Jakub -- you want to take a looksie at this one? Jason is on PTO for the next couple weeks. I'm not well versed enough to verify that d_i_m_o_d_1 has all the right checks or not. Jeff
Hello, On 08/18/2016 10:12 PM, Jeff Law wrote: > Jakub -- you want to take a looksie at this one? Jason is on PTO for > the next couple weeks. I'm not well versed enough to verify that > d_i_m_o_d_1 has all the right checks or not. Ping for the patch submitted at <https://gcc.gnu.org/ml/gcc-patches/2016-08/msg01315.html>. Thank you in advance!
On Thu, Aug 18, 2016 at 5:33 AM, Pierre-Marie de Rodat <derodat@adacore.com> wrote: > A check in dwarf2out_imported_module_or_decl prevents valid strict > DWARF2 constructs such as DW_TAG_imported_declaration from being emitted > in dwarf2out_imported_module_or_decl_1. > > The latter already protects the emission of newer DWARF tags with > appropriate checks, so the one in the former is redundant and > pessimistic. This function is already called from places like > process_scope_var, which are not protected anyway. > > This patch removes the check in dwarf2out_imported_module_or_decl so > that tags like DW_TAG_imported_declaration are emitted even in strict > DWARF2 mode. > > Bootstrapped and regtested on x86_64-linux, no regression. This check was added for bug 41405, a Darwin bootstrap problem. Dominique, can you verify that the compiler still bootstraps with this change? OK if so. Jason
> Le 28 sept. 2016 à 17:44, Jason Merrill <jason@redhat.com> a écrit : > > On Thu, Aug 18, 2016 at 5:33 AM, Pierre-Marie de Rodat > <derodat@adacore.com> wrote: >> A check in dwarf2out_imported_module_or_decl prevents valid strict >> DWARF2 constructs such as DW_TAG_imported_declaration from being emitted >> in dwarf2out_imported_module_or_decl_1. >> >> The latter already protects the emission of newer DWARF tags with >> appropriate checks, so the one in the former is redundant and >> pessimistic. This function is already called from places like >> process_scope_var, which are not protected anyway. >> >> This patch removes the check in dwarf2out_imported_module_or_decl so >> that tags like DW_TAG_imported_declaration are emitted even in strict >> DWARF2 mode. >> >> Bootstrapped and regtested on x86_64-linux, no regression. > > This check was added for bug 41405, a Darwin bootstrap problem. > Dominique, can you verify that the compiler still bootstraps with this > change? OK if so. OK, but not before tomorrow afternoon. Dominique > Jason
I have bootstrapped revision r240599 with the patch https://gcc.gnu.org/ml/gcc-patches/2016-08/msg01315.html without any problem. However compiling the following Fortran tests FAIL: gfortran.dg/binding_label_tests_16.f03 -g (internal compiler error) FAIL: gfortran.dg/module_commons_3.f90 -g (internal compiler error) FAIL: gfortran.dg/module_equivalence_1.f90 -g (internal compiler error) FAIL: gfortran.dg/use_11.f90 -g (internal compiler error) FAIL: gfortran.dg/use_only_1.f90 -g (internal compiler error) FAIL: gfortran.dg/widechar_5.f90 -g (internal compiler error) FAIL: libgomp.fortran/udr15.f90 -g (internal compiler error) are giving an ICE with -g of the kind internal compiler error: in dwarf2out_imported_module_or_decl, at dwarf2out.c:24070 corresponding to gcc_assert (scope_die->die_child); The Ada test gnat.dg/debug7.adb is also failing with FAIL: gnat.dg/debug7.adb (test for excess errors) Excess errors: gnat1: incorrect object file extension Dominique > Le 28 sept. 2016 à 17:44, Jason Merrill <jason@redhat.com> a écrit : > > On Thu, Aug 18, 2016 at 5:33 AM, Pierre-Marie de Rodat > <derodat@adacore.com> wrote: >> A check in dwarf2out_imported_module_or_decl prevents valid strict >> DWARF2 constructs such as DW_TAG_imported_declaration from being emitted >> in dwarf2out_imported_module_or_decl_1. >> >> The latter already protects the emission of newer DWARF tags with >> appropriate checks, so the one in the former is redundant and >> pessimistic. This function is already called from places like >> process_scope_var, which are not protected anyway. >> >> This patch removes the check in dwarf2out_imported_module_or_decl so >> that tags like DW_TAG_imported_declaration are emitted even in strict >> DWARF2 mode. >> >> Bootstrapped and regtested on x86_64-linux, no regression. > > This check was added for bug 41405, a Darwin bootstrap problem. > Dominique, can you verify that the compiler still bootstraps with this > change? OK if so. > > Jason
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 0fdab9a..7bc0378 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -24034,9 +24034,6 @@ dwarf2out_imported_module_or_decl (tree decl, tree name, tree context, && !should_emit_struct_debug (context, DINFO_USAGE_DIR_USE)) return; - if (!(dwarf_version >= 3 || !dwarf_strict)) - return; - scope_die = get_context_die (context); if (child) diff --git a/gcc/testsuite/gnat.dg/debug7.adb b/gcc/testsuite/gnat.dg/debug7.adb new file mode 100644 index 0000000..98230ba --- /dev/null +++ b/gcc/testsuite/gnat.dg/debug7.adb @@ -0,0 +1,10 @@ +-- { dg-do compile } +-- { dg-options "-cargs -g -gdwarf-2 -gstrict-dwarf -dA" } +-- { dg-final { scan-assembler "DW_TAG_imported_decl" } } + +package body Debug7 is + function Next (I : Integer) return Integer is + begin + return I + 1; + end Next; +end Debug7; diff --git a/gcc/testsuite/gnat.dg/debug7.ads b/gcc/testsuite/gnat.dg/debug7.ads new file mode 100644 index 0000000..047d4a6 --- /dev/null +++ b/gcc/testsuite/gnat.dg/debug7.ads @@ -0,0 +1,4 @@ +package Debug7 is + function Next (I : Integer) return Integer; + function Renamed_Next (I : Integer) return Integer renames Next; +end Debug7;