This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/17336] AVRGCC ignores "volatile" keyword for "register" variables


------- Additional Comments From wilson at specifixinc dot com  2004-09-06 22:49 -------
Subject: Re:  New: AVRGCC ignores "volatile" keyword for "register"
 variables

m_klokov at mail dot ru wrote:
>  AVRGCC ignores "volatile" keyword for "register" variables
>  when -o2 or -o3 optimization option is used.

You didn't say what was wrong with the code.  Maybe you were expecting 
all references to the volatile register to be atomic?  They aren't. 
That isn't what volatile means.

There is also a more general problem here in that gcc knows what a 
volatile memory location is, but does not know what a volatile register 
is.  As a result, volatile register variables won't work the way you expect.

By the way, current gcc sources emit a warning for this testcase:
tmp.c:1: warning: volatile register variables don't work as you might wish


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17336


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]