|
From: | Graham Davies |
Subject: | Re: [avr-chat] Missed Optimisation ? |
Date: | Tue, 01 Mar 2011 10:24:59 -0500 |
bob wrote:
I didn't mean to imply 4 read-OR-write cycles, just that with an unknown hardware ...
For mercy's sake, the hardware (microcontroller) is not unknown to the compiler!
... the OR itself (which is a read-modify-write operation) could have side effects.
No, no, no, no, no. The compiler has placed the value in temporary storage on which accesses absoluteley cannot have side effects.
I think Erik is right, in ISRs either inspect the compiler code very carefully or write in assembler yourself.
Erik may be right for himself, but he is giving bad advice in general. Good general advise is a) understand the C language and b) make sure you can trust your tool chain.
Graham.
[Prev in Thread] | Current Thread | [Next in Thread] |