Options That Control Optimization
Currently I am using the gcc 4.7.3 compiling code for a Cortex-M4 device and I have a question regarding the options that control the optimization.
First I checked which flags are enabled/disabled when using the -Os option:
arm-none-
The I did the same check for the -O2 option:
arm-none-
I figured out that there are only three differences, so I tried to use the -Os option and set all flags as they would be when using the -O2 option:
-Os -fno-inline-
I was surprised that I did not get the same result as I would get with the -O2 option:
-Os -fno-inline-
text data bss
0x2c06 0x40 0x5dc
-O2
text data bss
0x34fc 0x44 0x5dc
So, I guess a specific optimization level cannot be cloned with a set of -f options. Is that true? Is there any information available that tells me what exactly the optimizer is doing in the different optimizer levels?
I also looked into the documentation (gcc.pdf), but I haven't found the answer to my question (maybe I overlooked it).
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Malte Krebs
- Solved:
- Last query:
- Last reply: