[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-chat] Missed Optimisation ?

From: Pertti Kellomäki
Subject: Re: [avr-chat] Missed Optimisation ?
Date: Wed, 2 Mar 2011 09:38:11 +0200

Like Colin said, the C standard defines the semantics of the language
in terms of an abstract machine. Normally the compiler is allowed to
use an "as if" approximation of the semantics and leave out things
that would not change the state of the abstract machine.

One way to look at volatile is that it is a way to tell the compiler
that you know things that the compiler does not know, and therefore
the compiler needs to do things "by the book", i.e. do all the things
that the abstract machine semantics requires it to do.

I don't have an AVR compiler handy, but it would be instructive to see
what the compiler generates for "result = result*0" where result is

reply via email to

[Prev in Thread] Current Thread [Next in Thread]