This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: What is "init_dummy"?
- To: law at cygnus dot com, egcs at cygnus dot com
- Subject: Re: What is "init_dummy"?
- From: Benjamin Redelings I <bredelin at ucsd dot edu>
- Date: Mon, 05 Jan 1998 16:25:38 -0800
- References: <16617.884030542@hurl.cygnus.com>
Hi, thanks for answering.
Jeffrey A Law wrote:
>
> In message <34B04545.B0FD46B5@ucsd.edu>you write:
> > Hi, I've been profiling (gprof) some code generated by egcs 971225, and
> > I keep getting random references to "init_dummy". Is this intensional?
> > Is there some documentation on what "init_dummy" is, so that I can guess
> > what the profiling output means?
> It's part of the global ctor/dtor support code as well as code to handle
> registration of exception handling information.
>
> jeff
Hmm... perhaps there is a problem here. I was trying to find out why
init_dummy takes 77% of the CPU time in my program. It isn't because
I'm using a bad test case... Most of the CPU time is NOT spent
initializing global constructurs, but in actual processing. (I can tell
because the program is interactive).
Of course, non-global constructors & destructors are called throughout
the code (its a symbolic code, not a numerical one).
Basically the problem seems to be that lots of functions are calling
"init_dummy" w/o cause. Although I tried compiling my code with "g++
-Wall -g3 -pg -fno-exceptions -O6 -fno-inline -DNDEBUG", gprof still
lists very simple functions as calling init_dummy once each time they
are invoked. For example (to extract a line from my code):
class Stream {
...
IndexI<pof>& Stream::data(int i) {return *filters[i].data;}
...
};
This line basically does nothing more than subscript and return a
pointer (well, a reference). This would normally be inlined... Does it
really need to call init_dummy?
Thanks,
-BenRI