Does GCC, when compiling C++ code, ever try to optimize for speed by choosing to inline functions that are not marked with the inline keyword?
inline
If you use '-finline-functions' or '-O3' it will inline functions. You can also use '-finline_limit=N' to tune how much inlining it does.