Gcc

gcc 的 -O2 選項有什麼作用?

  • June 28, 2018

gcc 的 -O2 選項有什麼作用?

例如。gcc -O2 file1.c -o file1.o

這些-O選項打開編譯器優化。來自man gcc

  -O2 Optimize even more.  GCC performs nearly all supported
      optimizations that do not involve a space-speed tradeoff.  As
      compared to -O, this option increases both compilation time and the
      performance of the generated code.

有關特定優化的列表,請參閱手冊頁。

引用自:https://unix.stackexchange.com/questions/452337