This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/47409] New: volatile struct member bug
- From: "regehr at cs dot utah.edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 22 Jan 2011 03:46:13 +0000
- Subject: [Bug c/47409] New: volatile struct member bug
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47409
Summary: volatile struct member bug
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: regehr@cs.utah.edu
The load/store shouldn't go away (especially at -O0).
regehr@home:~$ current-gcc -O0 vol.c -S -o -
foo:
pushl %ebp
movl %esp, %ebp
popl %ebp
ret
regehr@home:~$ cat small.c
const volatile int g_2 = 1;
int g_1 = 0;
void func_1 (void) {
g_1 = g_2;
}
int main (void) {
g_1 = g_2;
return 0;
}
regehr@home:~$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/mnt/z/z/compiler-install/gcc-r169118-install/libexec/gcc/i686-pc-linux-gnu/4.6.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/mnt/z/z/compiler-install/gcc-r169118-install
--program-prefix=r169118- --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 20110122 (experimental) (GCC)