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
Yes, especially if you have a high level of optimizations enabled.
There is a flag you can provide to the compiler to disable this: -fno-inline-functions.