Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22002

Changing compiler optimization levels doesn't change the compiled binary

$
0
0

I have been using arm-linux-gnueabi-gcc toolchain to cross compile a binary to arm. The strange thing is I don't get any differences in the compiled binaries though I change the optimization level. Even I was following this documentation from 'arm' and took the same source from it indicated below.

#include <stdio.h>
int main(){

   int x =10, y =20;
   int z;
   z =x+y;
   return 0;

}

I even went through the man page and I think I am using the optimization flag correctly. This is the exact code I use to compile.

arm-linux-gnueabi-gcc -O1 -o test test.c 

However, the 'test' object file produce doesn't change (The size of the compiled binary is the same) regardless of me changing the optimization level as indicated in above arm documentation . What could be the reason for it? Am I doing something wrong here? Thanks in advance.


Viewing all articles
Browse latest Browse all 22002

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>