This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/47273] References to unaligned packed structure members not allowed
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 14 Jan 2011 15:56:24 +0000
- Subject: [Bug c++/47273] References to unaligned packed structure members not allowed
- Auto-submitted: auto-generated
- References: <bug-47273-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47273
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
Component|c |c++
--- Comment #7 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-01-14 15:56:17 UTC ---
I don't know why we do not allow references to bind to unaligned data,
the Intel C++ compiler seems to accept the example.
Pointers and references are the same as far as optimizers and code
generation are concerned. For targets where the hardware cannot
do unaligned loads/stores a read-and-mask/read-modify-write cycle
is used. Accessing unaligned data can never be assumed to be atomic
(not even with hardware unaligned load/store support as the data
may cross cache-line boundaries).