On Sat, 5 Mar 2011, Graham Davies wrote:

Michael Hennebry wrote:

[this bit is me writing] ...  When debugging a program, I like to be
able to follow along the logic I expressed in the source code, so
I would not be happy if it had changed beyond all recognition ...

This is an argument against optimization generally,
not specifically the kind under discussion.

No, it isn't. It's an argument only against optimization that prevents me from "... follow[ing] along the logic I expressed in the source code" and that "change[s the program flow] beyond all recognition". I think in your eagerness to disagree with me you are ignoring what I actually write.

Your complaint is precisely that of the -O0 crowd on AVR-freaks.
It applies to neither of the optimizations under discussion.

... the as-if rule applies even to volatiles when the
compiler has enough information to use it.

No, it doesn't, for reasons that have been adequately explained, mainly conformance to the standard.

Except for atomicity, the semantics are the same ...

The C language is unaware of atomicity. The semantics are different in the presence of read side-effects.

Which are absent both in this case and
the one that started the discussion.

--
Michael   [email protected]
"Pessimist: The glass is half empty.
Optimist:   The glass is half full.
Engineer:   The glass is twice as big as it needs to be."

_______________________________________________
AVR-chat mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-chat

Reply via email to