This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Inlining again...


Op wo 07-05-2003, om 20:17 schreef Richard Guenther:
> Note that I just checked and found that _still_ not all empty functions
> are inlined... btw. how is the following counted insns wise?
> 
> template <bool f>
> struct blah {
> 	void foo() { if (f) { ... some code ... } }
> };
> 
> void bar()
> {
> 	blah<false>().foo();
> }
> 
> is in this case the size of foo counted with or without the code inside
> the if statement?

You can look at that in gdb:

(gdb) b tree-inline.c:inlinable_function_p

Then run for some time until you hit the breakpoint, and do:

(gdb) p (fn->decl.u1.i * 10)

That's your stmt count: 130 if you repace "some code" with "return;":

template <bool f>
struct blah {
	void foo() { if (f) { return; } }
};

void bar()
{
	blah<false>().foo();
}

Yes. 130. I can only: ouch.

Greetz
Steven




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]