Bug 69011

Summary: Inlined functions are no instrumented with -finstrument-functions
Product: [Retired] Red Hat Raw Hide Reporter: Stefan Sorensen <sts>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-07-16 22:38:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Test program none

Description Stefan Sorensen 2002-07-16 22:38:12 UTC
When compiling with -finstrument-functions, inlined functions are not
instrumented. Example with main calling a single (possibly) inlined function:

Without inlining:
$ gcc -finstrument-functions -o foo foo.c
$ ./foo
this_fn=0x8048404 call_site=0x420165c4
this_fn=0x80483d6 call_site=0x804842d

Both main and the called functions are instrumented.

With inlining:
$ gcc -O -finstrument-functions -o foo foo.c
$ ./foo
this_fn=0x8048404 call_site=0x420165c4

Only main has been instrumented.

gcc version: 3.1-7

Comment 1 Stefan Sorensen 2002-07-16 22:38:49 UTC
Created attachment 65585 [details]
Test program

Comment 2 Jakub Jelinek 2002-07-18 08:29:36 UTC
This is the expected behaviour until -finstrument-functions is reimplemented
on AST (it is currently down at RTL level and since AST inlining was introduced
(for C++ in 2.96-RH, for C in 3.0) thus -finstrument-functions code doesn't
see inlined function boundaries any longer.