[Top][All Lists]

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

Re: [avr-chat] Missed Optimisation ?

From: Michael Hennebry
Subject: Re: [avr-chat] Missed Optimisation ?
Date: Sat, 5 Mar 2011 15:14:17 -0600 (CST)
User-agent: Alpine 1.00 (DEB 882 2007-12-20)

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   address@hidden
"Pessimist: The glass is half empty.
Optimist:   The glass is half full.
Engineer:   The glass is twice as big as it needs to be."

reply via email to

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