GCC standard optimizations behavior

后端 未结 1 444
傲寒
傲寒 2021-01-18 02:15

Here I compile an input program with -O2 optimization level (with gcc 4.8.4) and measure the execution time:

gcc -O2 -c test.c -o obj.o
TIMEFORMAT=\'%3R\' &a         


        
1条回答
  •  不要未来只要你来
    2021-01-18 02:34

    There is 2 good optimization that should be know:

    • -O2: Optimize space and time (caution: does not initialize variable)
    • -Os: Optimize space and time (caution: does not initialize variable)

    0 讨论(0)
提交回复
热议问题