you'll know it when you need it ... seriously. unless you really know what you want and what you are doing the chances of outsmarting the compiler are very very slim.
there's a rather old but good video about this very topic that i just remembered:
http://media.ccc.de/browse/conferences/camp2007/cccamp07-en-...
and i think these are the corresponding slides: http://www.fefe.de/know-your-compiler.pdf