public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/45852] New: volatile structs are broken!
@ 2010-10-01  3:10 regehr at cs dot utah.edu
  2010-10-01  3:40 ` [Bug c/45852] " regehr at cs dot utah.edu
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: regehr at cs dot utah.edu @ 2010-10-01  3:10 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: volatile structs are broken!
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: regehr@cs.utah.edu
                CC: chenyang@cs.utah.edu


gcc should not be optimizing away the read from or write to this struct.

regehr@john-home:~$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/compiler-install/gcc-r164818-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=/home/regehr/z/compiler-install/gcc-r164818-install
--program-prefix=r164818- --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 20100930 (experimental) (GCC) 

regehr@john-home:~$ current-gcc -S -o - -O1 small.c 

        .file   "small.c"
        .text
        .globl  func_1
        .type   func_1, @function
func_1:
.LFB0:
        .cfi_startproc
        rep
        ret
        .cfi_endproc
.LFE0:
        .size   func_1, .-func_1
        .globl  g_18
        .data
        .align 4
        .type   g_18, @object
        .size   g_18, 4
g_18:
        .long   -6
        .ident  "GCC: (GNU) 4.6.0 20100930 (experimental)"
        .section        .note.GNU-stack,"",@progbits

regehr@john-home:~$ cat small.c

struct S1
{
  int f0;
};

volatile struct S1 g_18 = { -6 };

void
func_1 (void)
{
  g_18 = g_18;
}


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-01-17  8:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-01  3:10 [Bug c/45852] New: volatile structs are broken! regehr at cs dot utah.edu
2010-10-01  3:40 ` [Bug c/45852] " regehr at cs dot utah.edu
2010-10-01 10:27 ` [Bug rtl-optimization/45852] " rguenth at gcc dot gnu.org
2010-12-14 13:44 ` [Bug middle-end/45852] " jakub at gcc dot gnu.org
2010-12-14 14:55 ` amonakov at gcc dot gnu.org
2010-12-21  8:35 ` jakub at gcc dot gnu.org
2011-01-16 20:27 ` jakub at gcc dot gnu.org
2011-01-17  0:37 ` jakub at gcc dot gnu.org
2011-01-17  8:05 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).