This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[lto] fix reading subroutine DIEs

The patch below fixes a problem with reading subroutine DIEs.  If the
subroutine DIE had a DW_AT_abstract_origin, we would return that
reference without reading the DIE's children.  This would cause us to
read the child DIEs as toplevel DIEs, with disastrous results.  The fix
is to always read the child DIEs.

Committed to the LTO branch.


2007-10-29  Mark Mitchell  <>
	    Nathan Froyd  <>

	* lto.c (lto_read_subroutine_type_subprogram_DIE): Read the child
	DIEs even if we find an abstract origin for this DIE.

Index: lto.c
--- lto.c	(revision 129722)
+++ lto.c	(working copy)
@@ -2541,7 +2541,11 @@ lto_read_subroutine_type_subprogram_DIE 
   if (abstract_origin)
-    return abstract_origin;
+    {
+      result = abstract_origin;
+      goto read_children;
+    }
   /* The DWARF3 specification says that a return type is only
      specified for functions that return a value.  Therefore,
@@ -2619,6 +2623,7 @@ lto_read_subroutine_type_subprogram_DIE 
   /* Read the child DIEs, which are in the scope of RESULT.  */
+ read_children:
   if (TREE_CODE (result) == FUNCTION_DECL)
       saved_scope = context->scope;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]