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

gcc compiler optimization - influence on assembly

$
0
0

I am learning about gcc optimization. As far as I understand the compilers tries to improve/ reduce the code.

That is noticeable when I execute different files with different optimization levels. Adding -O3 during compiling I get the fastest result when I run the compiled program.

As it has been improved, I thought the assembly files must have less commands. However, when looking into that files I saw that it has even more than the default one.

  • Is it true that the assembly file will have more commands, nevertheless it is running faster than the other one? If yes, how is that possible? What has been improved?
  • What is the general influence on assembly / object files when using optimization flags in gcc?

Viewing all articles
Browse latest Browse all 22463


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