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
This commit is contained in:
Jakub Jelinek 2008-08-31 13:23:04 +02:00 committed by Jakub Jelinek
parent 08ab58b30f
commit 8518c095a8
5 changed files with 42 additions and 2 deletions

View file

@ -1,5 +1,9 @@
2008-08-31 Jakub Jelinek <jakub@redhat.com>
PR debug/37287
* dwarf2out.c (gen_namespace_die): For DECL_EXTERNAL modules don't
add source coords.
* dwarf2out.c (native_encode_initializer): Subtract min_index for
non-range array index. Handle VIEW_CONVERT_EXPR and NON_LVALUE_EXPR.

View file

@ -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);

View file

@ -1,3 +1,9 @@
2008-08-31 Jakub Jelinek <jakub@redhat.com>
PR debug/37287
* gfortran.dg/pr37287-1.f90: New test.
* gfortran.dg/pr37287-2.F90: New test.
2008-08-31 Daniel Kraft <d@domob.eu>
* gfortran.dg/typebound_generic_1.f03: New test.

View file

@ -0,0 +1,16 @@
! PR debug/37287
! { dg-do link }
! { dg-options "-g -DPR37287_1" }
! { dg-additional-sources pr37287-2.F90 }
module pr37287_1
use iso_c_binding, only : c_ptr, c_associated, c_null_ptr
implicit none
contains
subroutine set_null(ptr)
type(c_ptr), intent(out) :: ptr
ptr = c_null_ptr
end subroutine set_null
end module pr37287_1
end
! { dg-final { cleanup-modules "pr37287_1" } }
! { dg-final { cleanup-modules "pr37287_2" } }

View file

@ -0,0 +1,10 @@
! PR debug/37287
! { dg-do compile }
! { dg-options "-g" }
module pr37287_2
#ifdef PR37287_1
use pr37287_1
#endif
implicit none
end module pr37287_2
! { dg-final { cleanup-modules "pr37287_2" } }