Also, when in doubt, look things up in the C standard which you pass to -std=. Any case that you find practically not covered by printf, especially wrt to -O* would mean you are compiling code with unspecified/undefined behavior. It's not necessary to land in C's pitfalls if you learn to C properly. My own use of debuggers declined strongly since I started hanging out in freenode's ##c where I was made to grok the above wisdom.
cheers! mar77i