public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Inlining __cyg_profile_func_{enter,exit} ?
@ 2001-12-11  9:18 Bill Rugolsky Jr.
  2001-12-11 16:03 ` Richard Henderson
  0 siblings, 1 reply; 2+ messages in thread
From: Bill Rugolsky Jr. @ 2001-12-11  9:18 UTC (permalink / raw)
  To: gcc

Hi,

I'd like to use the -finstrument-functions to do little more than stuff
a few values on a circular queue that will be read out by another
thread, and I was wondering whether there is any inherent obstacle 
in the current implementation to inlining __cyg_profile_func_{enter,exit}?

With gcc-2.94.3/gcc-3.0.1, if one compiles
[gcc -O3 -finstrument-functions] the code below, it does not have
the intended effect.

============================
   #include <stdio.h>
   int depth;

   inline void 
   __attribute__((__no_instrument_function__))
   __cyg_profile_func_enter(void *this_fn, void *call_site)
   {
      ++depth;
   }


   inline void 
   __attribute__((__no_instrument_function__))
   __cyg_profile_func_exit(void *this_fn, void *call_site)
   {
      --depth;
   }
   
   void
   foo(void)
   {
      printf("%ld\n",depth);
   }
   
   int
   main(int argc, char *argv)
   {
      foo();
      return 0;
   }

============================

Regards,

   Bill Rugolsky


PS: Please CC me on any replies; I'm not subscribed to the list.

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

* Re: Inlining __cyg_profile_func_{enter,exit} ?
  2001-12-11  9:18 Inlining __cyg_profile_func_{enter,exit} ? Bill Rugolsky Jr.
@ 2001-12-11 16:03 ` Richard Henderson
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2001-12-11 16:03 UTC (permalink / raw)
  To: Bill Rugolsky Jr.; +Cc: gcc

On Tue, Dec 11, 2001 at 12:07:53PM -0500, Bill Rugolsky Jr. wrote:
> I was wondering whether there is any inherent obstacle 
> in the current implementation to inlining __cyg_profile_func_{enter,exit}?

Yes.  These additions are made after inlining.


r~

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

end of thread, other threads:[~2001-12-12  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-11  9:18 Inlining __cyg_profile_func_{enter,exit} ? Bill Rugolsky Jr.
2001-12-11 16:03 ` Richard Henderson

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).