|
|
|
|
| A question about GCC optimization O3. |
 A question about GCC optimization O3. - tchaikovsky [ 2007-02-14 15:50 | 135 byte(s)]
 Re: A question about GCC optimization O3. - tchaikovsky [ 2007-02-14 16:24 | 833 byte(s)]
|
|
|
|
[Original]
[Print]
[Top]
|
|
After I replaced O2 with O3, The generated target size increased. I don't know the difference of strategies of them. Who can help me?
|
|
|
----
程序之道犹如庄周梦蝶
|
|
[Original]
[Print]
[Top]
|
|
[Original]
[Print]
[Top]
|
OK, I see.
I researched the manual of GCC and found that the O3 option may cause the enlargement of the image.
-O3 Optimize yet more. ‘-O3’ turns on all optimizations specified by ‘-O2’ and also turns on the ‘-finline-functions’, ‘-funswitch-loops’ and ‘-fgcse-after-reload’ options.
The addtion options enabled when we replaced O2 with O3 are finline-funtcions, funswitch-loops and fgcse-after-reload.
finline-functions causes some simple functions be inserted to the place in caller,instead of the jump operation, just like the inline function. Of cause, the speed is faster than later, but the size of binary code increased. funswitch-loops causes will move some codes in loop out of the loop. This causes the size increased too.
|
|
|
----
程序之道犹如庄周梦蝶
|
|
[Original]
[Print]
[Top]
|
|
|