This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/23623] New: volatile keyword changes bitfield access size from 32bit to 8bit
- From: "m dot reszat at kostal dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Aug 2005 14:02:29 -0000
- Subject: [Bug c/23623] New: volatile keyword changes bitfield access size from 32bit to 8bit
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
struct
{
unsigned int b : 1;
} bf1;
volatile struct
{
unsigned int b : 1;
} bf2;
void test(void)
{
bf1.b = 1;
bf2.b = 1;
}
Access to bf1.b is correctly done as 32-bits (lwz/stw opcodes), bf2.b is
accessed as 8-bits (lbz/stb opcodes). GCC3.4.3 shows the same behaviour, can't
go back any further. The same happens when the bitfield itself is made volatile,
not the whole struct.
--
Summary: volatile keyword changes bitfield access size from 32bit
to 8bit
Product: gcc
Version: 4.0.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: m dot reszat at kostal dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: i686-pc-cygwin
GCC target triplet: powerpc-elf-eabispe
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23623