gccの-O2オプションは何をしますか? [閉鎖]

gccの-O2オプションは何をしますか? [閉鎖]

gccの-O2オプションは何をしますか?

例えば。gcc -O2 file1.c -o file1.o

ベストアンサー1

この-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.

特定の最適化のリストについては、マニュアルページを参照してください。

おすすめ記事