title: How to find out which specific optimization affects my code significantly using gcc
body: <p>I used to think that I can mimic <code>-O1</code> in gcc by specifying <code>-fauto-inc-dec</code> and all the rest mentioned in <a href="http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html" rel="nofollow noreferrer">optimization options</a> for level one optimization. However, I was wrong because of one answer to this <a href="https://stackoverflow.com/questions/1778655/how-to-get-gcc-o1-optimization-without-specifying-o1">question</a>.</p>
  
  <p>Let's say <code>-O1</code> indeed introduces significant impact on the code, then how can I find which optimization methods account for the difference?</p>
  
  <p>EDIT:</p>
  
  <p>I have used <code>gcc -c -Q -O1 --help=optimizers</code>, suggested in the answer to find out all the optimizer used in <code>-O1</code>, and use them using <code>-foptimizer</code> syntax. However, no significant difference is observed. Some optimizations don't have corresponding <code>-foptimizer</code> syntax, as mention in this <a href="https://stackoverflow.com/questions/1778655/how-to-get-gcc-o1-optimization-without-specifying-o1">question</a>, and I guess the hidden ones are making huge difference in this case. How can I find them out? </p>