This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Inlining again...
- From: Steven Bosscher <s dot bosscher at student dot tudelft dot nl>
- To: Richard Guenther <rguenth at tat dot physik dot uni-tuebingen dot de>
- Cc: gcc at gcc dot gnu dot org
- Date: 07 May 2003 20:55:12 +0200
- Subject: Re: Inlining again...
- References: <Pine.LNX.4.44.0305072014280.432-100000@goofy>
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