I\'ve lately encountered a lot of functions where gcc generates really bad code on x86. They all fit a pattern of:
if (some_condition) { /* do something real
I would do it like this:
static void complex_function() {} void foo() { if(simple_case) { // do whatever return; } else { complex_function(); } }
The compiler my insist on inlining complex_function(), in which case you can use the noinline attribute on it.