[Bug c/47409] New: volatile struct member bug

regehr at cs dot utah.edu gcc-bugzilla@gcc.gnu.org
Sat Jan 22 04:13:00 GMT 2011


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)



More information about the Gcc-bugs mailing list