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]

Re: [RFC] PR 12389


> On Sun, 19 Oct 2003 03:46:16 +0200, Jan Hubicka <hubicka@ucw.cz> wrote:
> 
> > Why do we need knowing whether function is inlined in dwarf2out at first
> > place?
> 
> Because when a function is inlined the dwarf2 debug info is divided into
> abstract and concrete instances; for each inline function there is one
> abstract instance and possibly many concrete instances, one at each place
> it is inlined, and one for any out-of-line copy. 

I see, then I guess my second path to take a look into callgraph
structure and decide on wehtehr function actually gets inlined at least
once is current direction then, but there are couple side cases.

Alse this hunk looks incorrect to me:
      if (DECL_INLINE (decl) && !flag_no_inline)
	{
	  /* ??? Checking DECL_DEFER_OUTPUT is correct for static
	     inline functions, but not for extern inline functions.
	     We can't get this completely correct because information
	     about whether the function was declared inline is not
	     saved anywhere.  */
	  if (DECL_DEFER_OUTPUT (decl))
	    add_AT_unsigned (subr_die, DW_AT_inline, DW_INL_declared_inlined);
	  else
	    add_AT_unsigned (subr_die, DW_AT_inline, DW_INL_inlined);

Perhaps we want to use DECL_DECLARED_INLINE here?
in case function should get DW_INL_declared_inlined iff it has been
declared inline and actually inlining happent and
DW_INL_declared_not_inlined iff it has been declared inline and inlining
did't happen It would make more sense to do this:

      if (DECL_DECLARED_INLINE (decl)
	{
	  if (cgrpah_possibly_inlined_p (decl)
	    add_AT_unsigned (subr_die, DW_AT_inline, DW_INL_declared_inlined);
	  else
	    add_AT_unsigned (subr_die, DW_AT_inline, DW_INL_declared_not_inlined);
	}
      else if (cgraph_possibly_inlined_p (decl)
        add_AT_unsigned (subr_die, DW_AT_inline, DW_INL_inlined);

Also what about COOMDAT functions?  I guess the debug info should be
conservative then and always claim that function has been inlined as it
may be inlined in the other compilation unit, right?
Honza
> 
> Jason


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