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 probably refactor the code to encourage inlining of the simple case. That said, you can use -finline-limit
to make gcc
consider inlining larger functions, or -fomit-frame-pointer -fno-exceptions
to minimize the stack frame. (Note that the latter may break debugging and cause C++ exceptions to misbehave badly.)
Probably you won't be able to get much from tweaking compiler options, though, and will have to refactor.