[Info-vax] decrementing & for loops in C

Richard B. Gilbert rgilbert88 at comcast.net
Fri Jan 9 11:22:32 EST 2009


Tim E. Sneddon wrote:
> Bill Gunshannon wrote:
>> In article <49667A6E.3050507 at nowhere.com>,
>>     nobody <nobody at nowhere.com> writes:
>>> Turning off optimization should normally cause the program to execute 
>>> your program exactly as written.
>>
>> A program should always execute exactly as written.  No machine is smart
>> enough to second guess the intent of a human.
>>
> 
> That is arguable. After your code has been optimised
> it doesn't quite execute 'exactly as written'. The
> end result might be 'exactly as written'. However, the
> path to get there has been completely shuffled around
> by the compiler.
> 

And this is why my paper on debugging (DECUS Spring 1995) said to 
compile with /NOOPTIMIZE.  When you are as certain as you can be that 
it's working as intended, THEN you let the compiler optimize and you 
test it again.




More information about the Info-vax mailing list