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 tree-optimization/29753] [4.0/4.1/4.2/4.3 Regression] Volatile semantics ignored in some cases



------- Comment #3 from mmitchel at gcc dot gnu dot org  2006-11-12 21:33 -------
This is a tricky case, since the underlying memory pointed to by the pointer is
non-volatile.  In other words, the compiler knows that "s" is non volatile,
even though the pointer type is "volatile int *".

The C99 standard (5.1.2.3) says that "accessing a volatile object" is a
side-effect.  The C++ standard ([basic.intro]), however, says that "accessing
an object designated by a volatile lvalue" is a side-effect.   In this case, I
would think the object to be non-volatile, but the lvalue to be volatile.  

How confusing!


-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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


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