public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/23702] New: volatile const members of structures not treated as volatile
@ 2005-09-02 19:32 Steve at Zook dot com
  2005-09-02 19:34 ` [Bug c++/23702] " Steve at Zook dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Steve at Zook dot com @ 2005-09-02 19:32 UTC (permalink / raw)
  To: gcc-bugs

Volatile const members of a struct are not generating a load when read while 
volatile non-const members are loaded (volatile const objects outside of a 
structure do generate a load when read). const members of a volatile struct 
generate two loads when read (strange code being produced in this case). This 
has been seen in 3.3.3 (for x86 and m68k targets) and 3.4.4 (for m68k targets, 
untested on x86). The attached test.cpp file when compiled gcc -c -save-temps 
test.cpp on 3.3.3 under cygwin (x86 target) produces the attached test.s 
output. Multiple stores on volatile const members of structs get optimized 
away as well (this is not demonstrated in the attached test code). Note that 
when the test code is compiled as C rather than C++, correct code gets 
produced.

-- 
           Summary: volatile const members of structures not treated as
                    volatile
           Product: gcc
           Version: 3.4.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: Steve at Zook dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 5+ messages in thread
[parent not found: <bug-23702-7493@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2009-08-25 13:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-02 19:32 [Bug c++/23702] New: volatile const members of structures not treated as volatile Steve at Zook dot com
2005-09-02 19:34 ` [Bug c++/23702] " Steve at Zook dot com
2005-09-02 19:36 ` Steve at Zook dot com
2005-09-19 20:07 ` Steve at Zook dot com
     [not found] <bug-23702-7493@http.gcc.gnu.org/bugzilla/>
2009-08-25 13:59 ` bangerth at gmail dot com

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).