Inlining function pointers
Ian Lance Taylor
iant@google.com
Thu Aug 27 08:17:00 GMT 2009
yavuz yetim <yavuzyetim@hotmail.com> writes:
> I tried it on Mac OS X gcc-4.0.1 (I guess). The compiler complained.
Sounds like a bug in that relatively old compiler.
> Now I'm in the office and I just tried it with "gcc version 4.3.3
> (Ubuntu 4.3.3-5ubuntu4)" and it compiled fine. So, it's probably an
> issue with the old compiler. But the question is, even though it
> compiles, can it inline both of the functions? The assembly output
> shows that it doesn't either of them, but I don't know if it is the
> right place to look:
When I compile your test case with gcc mainline, it inlines both
functions into main.
> trash$gcc -finline-functions -S den.c
You need to compile with optimization (the -O option)--simply specifying
-finline-functions is insufficient.
Ian
More information about the Gcc-help
mailing list