public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/23629] New: -finstrument-functions + -finline-functions produces incorrect output.
@ 2005-08-30  0:39 yasushi dot saito at gmail dot com
  2005-08-30  0:39 ` [Bug c/23629] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: yasushi dot saito at gmail dot com @ 2005-08-30  0:39 UTC (permalink / raw)
  To: gcc-bugs

When a function is inlined, the corresponding calls to
__cyg_profile_func_{enter,exit} are passed the address of caller.

Below is an example. Addresses shown in "Enter"/"Exit" messages 
all point to main().
If you add -fno-inline-functions, then this problem goes away.

----- Makefile ------
CC=gcc-4.0.1
all: blah.o lib.o
        $(CC) -o a.out $^
blah.o: blah.c
        $(CC) -O3 -finstrument-functions -c $^
lib.o: lib.c
        $(CC) -O3 -c $^
------ blah.c -------
#include <stdio.h>
int Foo() { return 900; }
int Bar() { return Foo() + 10; }
int main() { printf("Value is %d\n", Bar()); }
------ lib.c --------
#include <stdio.h>
__cyg_profile_func_enter(void *this_fn, void *call_site) { printf("Enter %p\n",
this_fn); }
__cyg_profile_func_exit(void *this_fn, void *call_site) { printf("Exit %p\n",
this_fn); }

-- 
           Summary: -finstrument-functions + -finline-functions produces
                    incorrect output.
           Product: gcc
           Version: 4.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: yasushi dot saito at gmail dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c/23629] -finstrument-functions + -finline-functions produces incorrect output.
  2005-08-30  0:39 [Bug c/23629] New: -finstrument-functions + -finline-functions produces incorrect output yasushi dot saito at gmail dot com
@ 2005-08-30  0:39 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-30  0:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-30 00:39 -------


*** This bug has been marked as a duplicate of 23296 ***

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


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-08-30  0:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-30  0:39 [Bug c/23629] New: -finstrument-functions + -finline-functions produces incorrect output yasushi dot saito at gmail dot com
2005-08-30  0:39 ` [Bug c/23629] " pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).