[Bug debug/29792] DWARF: Not all inline concrete instances are being generated

acme at mandriva dot com gcc-bugzilla@gcc.gnu.org
Thu Nov 16 01:53:00 GMT 2006



------- Comment #12 from acme at mandriva dot com  2006-11-16 01:53 -------
(In reply to comment #11)
> Subject: Re:  DWARF: Not all inline concrete instances are being generated
> 
> > OK, so I'll have to find another way of using the DWARF info to see if a inline
> > routine, such as __task_rq_lock was used at all in the build or was just
> > included in the DWARF info but not referenced anywhere, have to dig more into
> > the available information...
> >
> > BTW, if, in these cases, DW_TAG_subroutine is not referenced, what is the
> > purpose of it being included? Is there a reason my limited knowledge is not
> > realising?
> 
> Well, it is referenced. It did exist in the source, and was inlined.
> That's what we output.  DW_TAG_subprogram with no PC range is actually
> common.
> 
> Because all the inlined instances were optimized away, there are no
> DW_TAG_inlined_* entries for them.

/me slaps himself in the face

Duh, should have checked this :-)

[acme@newtoy examples]$ cat a.c
static inline int foo(int i)
{
        return i + 10;
}

int main(void)
{
}
[acme@newtoy examples]$ readelf -wi a |grep foo
[acme@newtoy examples]$

Excellent, only if its not static:

[acme@newtoy examples]$ cat a.c
inline int foo(int i)
{
        return i + 10;
}

int main(void)
{
}
[acme@newtoy examples]$ readelf -wi a |grep foo
     DW_AT_name        : foo
[acme@newtoy examples]$

And in this case my tool, prefcnt, should warn that this routine, inline or
not, is not being used at all and is eligible to go to the dustbin.

Thanks a lot for your patience and advise, closing the ticket as INVALID.


-- 

acme at mandriva dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29792



More information about the Gcc-bugs mailing list