Can GCC optimize things better when I compile everything in one step?

后端 未结 3 1941

gcc optimizes code when I pass it the -O2 flag, but I\'m wondering how well it can actually do that if I compile all source files to object files and then link them

3条回答
  •  暖寄归人
    2021-02-13 21:46

    You may be looking for Link-Time Optimization (LTO), aka Whole Program Optimization.

提交回复
热议问题