Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 1
    The funny thing is: -O2 -fno-omit-frame-pointer is just as good as -Os. Please check the updated question. Commented Oct 20, 2013 at 14:12
  • According to gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html, all your flags are enabled at both -O2, -O3. Commented Sep 24, 2020 at 5:27
  • @xamid Saying that -O2 enables -falign-functions -falign-jumps -falign-labels -falign-loops is meaningless. Each of these options take a numerical argument. The argument they receive for most target architectures when they are enabled automatically by -O2 is not 1. Setting them to 1 effectively disables these “optimizations” that often make the binary code slower. Commented Sep 24, 2020 at 12:18
  • @PascalCuoq It reads for example "-fno-align-functions and -falign-functions=1 are equivalent and mean that functions are not aligned" But I just noticed that they probably mean just the opposite by the following "Enabled at levels -O2, -O3." So I guess my previous commment is false, not meaningless. I will check your flags, thanks. :-) Commented Sep 24, 2020 at 13:26
  • 3
    I would like to mention that now that I used -O3 -fno-align-functions -fno-align-jumps -fno-align-loops -fno-align-labels instead of only -O3, my app actually runs faster, and it also decreased the executable file size. Commented Sep 26, 2020 at 8:47