This appears to be the fault of egcs, and not the code. Statements should be evauluated left to right (well at least it seems this way). Have you tried compiling with lesser optimizations enabled? - alex