Compiler support for one-trip do loops

Also mentioned in this post: Poll: refactoring a chunk of legacy code - #12 by mecej4