[Top][All Lists]

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

Re: [avr-chat] Missed Optimisation ?

From: Graham Davies
Subject: Re: [avr-chat] Missed Optimisation ?
Date: Sat, 05 Mar 2011 16:46:04 -0500

Michael Hennebry wrote:

Your complaint is precisely that of the -O0 crowd on AVR-freaks.

No, it isn't. You're so wrapped up in the need to disagree with me that you're not looking at what I'm writing. I don't give a hoot what the "-O0 crowd on AVR-freaks" complain about. I'm writing that I (that's me, not you, not then, not everyone in the world, just me) want to be able to follow my program logic in the debugger using my (not your or anyone else's) intellectual limitations. These encompass the optimizations I see in gcc right now, but would not extend to the compiler being totally free to do absolutely anything as long as the result was the same. I am skeptical that others have intellectual limitations much less restricting in this regard than my own, but they will make up their own minds.

It applies to neither of the optimizations under discussion.

The original comment and my reply to did not restrict the context to any particular optimization(s).

[read side-effects] are absent both in this case and
the one that started the discussion.

That is not the point. The C language includes only one semantic feature that lets the programmer instruct the compiler to avoid optimizations that would not give him the desired behavior due to 1) read side effects, 2) write side effects, 3) memory shared with another execution thread in the same CPU, 4) memory shared with a different CPU, etc. The compiler does not know for which precise reason the programmer used the volatile storage qualifier. The compiler sees that the qualifier has been used and then must / should follow certain rules (which have been discussed). You cannot argue that the compiler is producing standard-conforming code when it does not follow the rules just because you have knowledge that isn't available to it. You can argue that the code, although not standard-conforming, is acceptable or even superior, but I have already joined that side of the argument, so again you appear to be more interested in disagreeing with me that understanding what I am saying.


P.S. This really is it for me on this thread. I don't seem to be helping anyone, which is supposed to be the point of these groups, so I might as well save my time. If Michael's rule is that the last one to post on a topic wins, then I hereby concede victory to him on his next post.

reply via email to

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