This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33068] New: volatile struct bit fields not treated as volatile
- From: "Steve at Zook dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Aug 2007 17:20:30 -0000
- Subject: [Bug c++/33068] New: volatile struct bit fields not treated as volatile
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
When individual bit field members of a struct/class are declared as volatile,
the generated code may not treat them as volatile (code varies with -O and
-m<processor> choices). Non-bit field volatile members and bit field members of
volatile structs are always treated as volatile. The problem can be worked
around by declaring the entire structure volatile.
m68k-elf-g++ and m68k-elf-gcc both generate the bad code when compiling C++,
however, m68k-elf-gcc generates good code when compiling the same test code as
C. I will attach a test.c file which can be compiled as C or C++.
--
Summary: volatile struct bit fields not treated as volatile
Product: gcc
Version: 4.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: Steve at Zook dot com
GCC host triplet: i686-pc-cygwin
GCC target triplet: m68k-elf
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33068