[Bug target/56997] Incorrect write to packed field when strict-volatile-bitfields enabled on aarch32

joey.ye at arm dot com gcc-bugzilla@gcc.gnu.org
Thu Apr 18 08:12:00 GMT 2013


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

--- Comment #1 from Joey Ye <joey.ye at arm dot com> 2013-04-18 08:12:50 UTC ---
Quoted from
http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Code-Gen-Options.html#Code-Gen-Options:

-fstrict-volatile-bitfields
    If the target requires strict alignment, and honoring the field type would
require violating this alignment, a warning is issued. If the field has packed
attribute, the access is done without honoring the field type. If the field
doesn't have packed attribute, the access is done honoring the field type. In
both cases, GCC assumes that the user knows something about the target hardware
that it is unaware of.

There are two issues in current behavior:
1. There is no warning when writing to packed fields requiring strict
alignment. Although there is a warning when reading it.
2. The write access to packed field still honors the field type.



More information about the Gcc-bugs mailing list