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/16721] [3.5 Regression] Accesses to volatile objects optimized away


------- Additional Comments From macro at linux-mips dot org  2004-07-27 12:25 -------
(In reply to comment #2)
> I can reproduce this on alphaev68-linux.
> 
> In the test case you gave, removing the access seems entirely appropriate
> to me, since addr is not volatile.
> 
> However, the same happens if you mark it volatile, so this is really a bug.
> -fno-strict-aliasing is a red herring; the access also gets optimized away for
> 
> struct data { volatile unsigned long addr; } p;
> void test() { p.addr; }
> 
> at -O2.
> 

p->addr is not volatile, but *p->addr is.  Threfore the original test case is valid.

-- 


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


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