Does GCC inline C++ functions without the 'inline' keyword?

前端 未结 4 1037
不知归路
不知归路 2020-12-03 04:45

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?

4条回答
  •  难免孤独
    2020-12-03 05:01

    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.

提交回复
热议问题