This is the mail archive of the gcc-patches@gcc.gnu.org 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]

PATCH Re: hitting add_abstract_origin_attribute abort()


>>>>> Jakub Jelinek <jakub@redhat.com> writes:

 > You've recently added abort() in:

 > 	* dwarf2out.c (add_abstract_origin_attribute): Do call abort if
 > 	the abstract origin wasn't emitted.

 > Now I cannot any more bootstrap gcc on sparc64-redhat-linux (64bit), as it
 > aborts on compiling tinfo.cc.

The abort was there before; I just put it back after Mark removed it, so
that things would break loudly rather than quietly.

The problem is that the tree block structure does not accurately reflect
the logical block structure; the block for a catch block in an inlined
function is not nested within the block for the inlined function itself.
Furthermore, it appears *before* the inlined function block, so we haven't
generated the abstract instance for that function yet, so when we try to
reference it we fail.

It occurs to me that with cleanups and exception handlers it may not be
feasible to require that they fall within the blocks for the functions they
come from, since we want to move exception handlers to the end of the
function for improved code locality in the non-exception case, and we
build the tree block structure from the NOTE_INSN_BLOCK_* notes.

I don't understand why the handler block ends up before the function block,
though.  That may be a bug, but I'm going on vacation in the morning, so I
won't be able to look at it any more until January.  In the meantime, I've
checked in this patch, which removes the crash and generates reasonable
debug info.

Jason

1999-12-22  Jason Merrill  <jason@casey.cygnus.com>

	* dwarf2out.c (add_abstract_origin_attribute): Call
	gen_abstract_function on our function context.

Index: dwarf2out.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/dwarf2out.c,v
retrieving revision 1.134
diff -c -p -r1.134 dwarf2out.c
*** dwarf2out.c	1999/12/15 09:05:18	1.134
--- dwarf2out.c	1999/12/23 05:17:47
*************** add_abstract_origin_attribute (die, orig
*** 7505,7510 ****
--- 7505,7517 ----
  {
    dw_die_ref origin_die = NULL;
  
+   /* We may have gotten separated from the block for the inlined
+      function, if we're in an exception handler or some such; make
+      sure that the abstract function has been written out.  */
+   tree fn = decl_function_context (origin);
+   if (fn)
+     gen_abstract_function (fn);
+ 
    if (TREE_CODE_CLASS (TREE_CODE (origin)) == 'd')
      origin_die = lookup_decl_die (origin);
    else if (TREE_CODE_CLASS (TREE_CODE (origin)) == 't')


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