public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/33068] New: volatile struct bit fields not treated as volatile
@ 2007-08-14 17:20 Steve at Zook dot com
2007-08-14 17:28 ` [Bug c++/33068] " Steve at Zook dot com
0 siblings, 1 reply; 4+ messages in thread
From: Steve at Zook dot com @ 2007-08-14 17:20 UTC (permalink / raw)
To: gcc-bugs
When individual bit field members of a struct/class are declared as volatile,
the generated code may not treat them as volatile (code varies with -O and
-m<processor> choices). Non-bit field volatile members and bit field members of
volatile structs are always treated as volatile. The problem can be worked
around by declaring the entire structure volatile.
m68k-elf-g++ and m68k-elf-gcc both generate the bad code when compiling C++,
however, m68k-elf-gcc generates good code when compiling the same test code as
C. I will attach a test.c file which can be compiled as C or C++.
--
Summary: volatile struct bit fields not treated as volatile
Product: gcc
Version: 4.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: Steve at Zook dot com
GCC host triplet: i686-pc-cygwin
GCC target triplet: m68k-elf
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33068
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/33068] volatile struct bit fields not treated as volatile
2007-08-14 17:20 [Bug c++/33068] New: volatile struct bit fields not treated as volatile Steve at Zook dot com
@ 2007-08-14 17:28 ` Steve at Zook dot com
0 siblings, 0 replies; 4+ messages in thread
From: Steve at Zook dot com @ 2007-08-14 17:28 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from Steve at Zook dot com 2007-08-14 17:28 -------
Created an attachment (id=14059)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14059&action=view)
Test C or C++ code fragment
For bad code compile: m68k-elf-gcc -c -save-temps -x c++ test.c
or: m68k-elf-g++ -c -save-temps test.c
note code for ProcedureBitStructVolatile() and
ProcedureBitStructVolatileConst()
for good code compile: m68k-elf-gcc -c -save-temps test.c
or: m68k-elf-g++ -c -save-temps -x c test.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33068
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/33068] volatile struct bit fields not treated as volatile
[not found] <bug-33068-4@http.gcc.gnu.org/bugzilla/>
2013-04-09 17:05 ` paolo.carlini at oracle dot com
@ 2024-04-04 1:44 ` pinskia at gcc dot gnu.org
1 sibling, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-04 1:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=33068
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |13.1.0
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Looks working GCC 13:
ProcedureBitStructVolatile():
.LFB12:
.cfi_startproc
move.w BitStruct,%d0
rts
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/33068] volatile struct bit fields not treated as volatile
[not found] <bug-33068-4@http.gcc.gnu.org/bugzilla/>
@ 2013-04-09 17:05 ` paolo.carlini at oracle dot com
2024-04-04 1:44 ` pinskia at gcc dot gnu.org
1 sibling, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-04-09 17:05 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33068
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC|gcc-bugs at gcc dot gnu.org |schwab@linux-m68k.org
--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2013-04-09 17:05:55 UTC ---
Maybe Andreas is willing to revisit this issue.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-04-04 1:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-14 17:20 [Bug c++/33068] New: volatile struct bit fields not treated as volatile Steve at Zook dot com
2007-08-14 17:28 ` [Bug c++/33068] " Steve at Zook dot com
[not found] <bug-33068-4@http.gcc.gnu.org/bugzilla/>
2013-04-09 17:05 ` paolo.carlini at oracle dot com
2024-04-04 1:44 ` pinskia 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).