That's what pretty much any half-decent compiler does nowadays. It'd be much more surprising if it didn't.