[Bug c/17336] AVRGCC ignores "volatile" keyword for "register" variables
m_klokov at mail dot ru
gcc-bugzilla@gcc.gnu.org
Fri Sep 24 18:07:00 GMT 2004
------- Additional Comments From m_klokov at mail dot ru 2004-09-24 18:07 -------
(In reply to comment #4)
> Not a bug, volatile on global registers means nothing.
Why do you think so?
Volatile means volatile, it shouldn't depend of "register"
or not, global or local.
Anyway compiler should assume that this variable can be altered
by external process (thread, interrupt handler or hardware).
So it souldn't copy this value to another temporary place and
use this copy when I want to read this value, as the real value
CAN BE CHANGED. Please refere to samples I provided before.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17336
More information about the Gcc-bugs
mailing list