[taken from gcc-2.96]

2001-02-07  Alexandre Oliva <aoliva@redhat.com>
	* dwarf2out.c (gen_subprogram_die): Don't call
	add_abstract_origin_attribute if lookup_decl_die is NULL.
	2001-02-07  Jakub Jelinek  <jakub@redhat.com>
	* gcc.dg/20010207-1.c: New test.


git-svn-id: file:///srv/svn/repos/haiku/trunk/buildtools@9606 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Tappe 2004-10-28 18:28:10 +00:00
parent 49d0b42456
commit 3516ced06b

View File

@ -8359,7 +8359,16 @@ gen_subprogram_die (decl, context_die)
if (origin != NULL) if (origin != NULL)
{ {
subr_die = new_die (DW_TAG_subprogram, context_die); subr_die = new_die (DW_TAG_subprogram, context_die);
add_abstract_origin_attribute (subr_die, origin); /* lookup_decl_die (origin) may be NULL if decl is a copy of an
implicit declaration of a function that was created while
inlining a function that referenced the function without a
prior declaration. Since we don't emit such implicit
declarations in the first place, there's no point in linking
this copy to it. Besides, add_abstract_origin_attribute()
would crash. */
if (TREE_CODE (origin) != FUNCTION_DECL
|| lookup_decl_die (origin))
add_abstract_origin_attribute (subr_die, origin);
} }
else if (old_die && DECL_ABSTRACT (decl) else if (old_die && DECL_ABSTRACT (decl)
&& get_AT_unsigned (old_die, DW_AT_inline)) && get_AT_unsigned (old_die, DW_AT_inline))