Even when compiled with -O3, the call to f() is not inlined in the following testcase:
typedef void (*fptr_t)(); void extfunc(const fptr_t *f); static inline void inlinable() {} void test() { const fptr_t f = inlinable; extfunc(&f); f(); } $ gcc-4.4 -v Using built-in specs. Target: x86_64-unknown-linux-gnu Configured with: ../gcc-svn/configure --program-suffix=-4.4 --enable-languages=c Thread model: posix gcc version 4.4.0 20090218 (experimental) (GCC) -- Summary: Call to constant function pointer not inlined Product: gcc Version: 4.4.0 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: dpirch at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39234