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]
Other format: [Raw text]

[PATCH] Fix PR debug/19327


Hi,

The patch

2005-01-03  Daniel Berlin  <dberlin@dberlin.org>

	Fix PR debug/17924
	Fix PR debug/19191
	* dwarf2out.c (block_ultimate_origin): Follow decl origin if origin
	is a decl.
	* gimple-low.c (mark_blocks_with_used_vars): New function.
	(mark_blocks_with_used_subblocks): Ditto.
	(mark_used_blocks): Ditto.
	(pass_mark_used_blocks): New pass.
	* tree-inline.c: Include debug.h.
	(expand_call_inline): Call outlining_inline_function here.
	* tree-optimize.c (init_tree_optimization_passes): Add
	pass_mark_used_blocks. 
	* tree-pass.h (pass_mark_used_blocks): New.
	* Makefile.in (tree-inline.o): Add debug.h dependency.

has introduced the following regression on platforms using STABS:

FAIL: gcc.c-torture/execute/921215-1.c compilation,  -O3 -g 
UNRESOLVED: gcc.c-torture/execute/921215-1.c execution,  -O3 -g 

as well as broken Ada bootstrap.


The problem is that the compiler emits an undefined reference into the .stabs 
section.  The DBX back-end is now asked to output debug info for the inlined 
instance of the nested function r in

main()
{
#ifndef NO_TRAMPOLINES
  void p(void ((*f) (void ())))
    {
      void r()
	{
	  foo ();
	}

      f(r);
    }

  void q(void ((*f)()))
    {
      f();
    }

  p(q);
#endif
  exit(0);
}

which is created when p is inlined.  Now the inline instance is of course 
never emitted as a function proper in the assembly.


The proposed fix is to instruct the backend to skip inline instances of nested 
functions.  Bootstrapped/regtested (including Ada) on sparc-sun-solaris2.5.1.


2005-01-18  Eric Botcazou  <ebotcazou@libertysurf.fr>

	* dbxout.c (dbxout_symbol) <FUNCTION_DECL>: Skip inline instance of
	nested functions.


-- 
Eric Botcazou
Index: dbxout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dbxout.c,v
retrieving revision 1.216
diff -u -p -r1.216 dbxout.c
--- dbxout.c	9 Dec 2004 10:54:32 -0000	1.216
+++ dbxout.c	17 Jan 2005 15:57:45 -0000
@@ -2429,6 +2429,9 @@ dbxout_symbol (tree decl, int local ATTR
       context = decl_function_context (decl);
       if (context == current_function_decl)
 	break;
+      /* Don't mention an inline instance of a nested function.  */
+      if (context && DECL_FROM_INLINE (decl))
+	break;
       if (!MEM_P (DECL_RTL (decl))
 	  || GET_CODE (XEXP (DECL_RTL (decl), 0)) != SYMBOL_REF)
 	break;

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