I am learning optimization by gcc. From Optimization levels,it is given that in level Os , gcc specifically select optimization required to reduce size of executable. I wrote simple program.
#include<stdio.h>
int main()
{
const int k=7;
printf("k = %d\n",k);
return 0;
}
And tested for all levels. It gave me size as follows
O0 - 4883
O1 - 4883
O2 - 4867
O3 -4867
Os - 4879
It should give least size in level Os . But it did not do so. Can anyone please tell me if I am wrong. Thanks