title: Compile options -g debug and -O optimization
body: <p>I am not quite familiar with g++ compilers, especially the options, e.g., -s, -g, and -O.</p>
  
  <p>Firstly, can I ask when do these options take effect? During compile or link phase? I normally put all the options I need in both phases.</p>
  
  <p>Secondly, are there -g1, -g2, -g3 options? I know -g adds debugging info in the to executable. How do others differ?</p>
  
  <p>Thirdly, what does -s do? Do -s, -g, and -O3 work together? My target is to make the executable 1) run quickly, and 2) have small size if possible. What do you suggest?</p>