diff options
author | Jakub Jelinek <jakub@redhat.com> | 2008-08-31 13:23:04 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2008-08-31 13:23:04 +0200 |
commit | 8518c095a8aaa6375e1e7046c824d7c2a9893855 (patch) | |
tree | fe5f232d4f000ad440e632ec1ee70ebbbcbe88a0 /gcc/dwarf2out.c | |
parent | 08ab58b30f4ae0b42751ce52ac444691e6da2606 (diff) | |
download | gcc-8518c095a8aaa6375e1e7046c824d7c2a9893855.zip gcc-8518c095a8aaa6375e1e7046c824d7c2a9893855.tar.gz gcc-8518c095a8aaa6375e1e7046c824d7c2a9893855.tar.bz2 |
re PR debug/37287 (ICE (segfault) with new debugging patch)
PR debug/37287
* dwarf2out.c (gen_namespace_die): For DECL_EXTERNAL modules don't
add source coords.
* gfortran.dg/pr37287-1.f90: New test.
* gfortran.dg/pr37287-2.F90: New test.
From-SVN: r139826
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 6a8d34c..3e1bd5a6 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -15036,11 +15036,15 @@ gen_namespace_die (tree decl) they are an alias of. */ if (DECL_ABSTRACT_ORIGIN (decl) == NULL) { - /* Output a real namespace. */ + /* Output a real namespace or module. */ dw_die_ref namespace_die = new_die (is_fortran () ? DW_TAG_module : DW_TAG_namespace, context_die, decl); - add_name_and_src_coords_attributes (namespace_die, decl); + /* For Fortran modules defined in different CU don't add src coords. */ + if (namespace_die->die_tag == DW_TAG_module && DECL_EXTERNAL (decl)) + add_name_attribute (namespace_die, dwarf2_name (decl, 0)); + else + add_name_and_src_coords_attributes (namespace_die, decl); if (DECL_EXTERNAL (decl)) add_AT_flag (namespace_die, DW_AT_declaration, 1); equate_decl_number_to_die (decl, namespace_die); |