This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/47273] References to unaligned packed structure members not allowed


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]