Inlining again...
Steven Bosscher
s.bosscher@student.tudelft.nl
Wed May 7 18:56:00 GMT 2003
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
More information about the Gcc
mailing list