[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
volatile.
--
Pertti
- RE: [avr-chat] Missed Optimisation ?, (continued)
- RE: [avr-chat] Missed Optimisation ?, Boyapati, Anitha, 2011/03/02
- RE: [avr-chat] Missed Optimisation ?, Boyapati, Anitha, 2011/03/02
- Re: [avr-chat] Missed Optimisation ?, bob, 2011/03/01
- Re: [avr-chat] Missed Optimisation ?, bob, 2011/03/01
- Re: [avr-chat] Missed Optimisation ?, Graham Davies, 2011/03/01
- Re: [avr-chat] Missed Optimisation ?, Michael Hennebry, 2011/03/01
- Re: [avr-chat] Missed Optimisation ?, Michael Hennebry, 2011/03/02
- Re: [avr-chat] Missed Optimisation ?, Alex Eremeenkov, 2011/03/02
- Re: [avr-chat] Missed Optimisation ?, Michael Hennebry, 2011/03/02
- Re: [avr-chat] Missed Optimisation ?, Alex Eremeenkov, 2011/03/02
- Re: [avr-chat] Missed Optimisation ?, Michael Hennebry, 2011/03/03
- Message not available
- Re: [avr-chat] Missed Optimisation ?, Michael Hennebry, 2011/03/03
- Re: [avr-chat] Missed Optimisation ?, Pertti Kellomäki, 2011/03/04
- Re: [avr-chat] Missed Optimisation ?, Graham Davies, 2011/03/04
- Re: [avr-chat] Missed Optimisation ?, Michael Hennebry, 2011/03/05