fix Issue 9387 - Compiler switch -O changes behavior of correct code

fix Issue 9387 - Compiler switch -O changes behavior of correct code

http://d.puremagic.com/issues/show_bug.cgi?id=9387