[Bug target/83748] Local variables not aligned to word boundary
segher at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Mar 6 18:42:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83748
Segher Boessenkool <segher at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |RESOLVED
Resolution|--- |WORKSFORME
--- Comment #7 from Segher Boessenkool <segher at gcc dot gnu.org> ---
Closing this now.
This was fixed in 2013, in r205896 -- so should be fixed in 4.9 already.
That commit added this to the documentation:
In some cases, such as when the 'packed' attribute is applied to a
structure field, it may not be possible to access the field with a
single read or write that is correctly aligned for the target
machine. In this case GCC falls back to generating multiple
accesses rather than code that will fault or truncate the result at
run time.
(and also added the code to implement it; as you noticed, older compilers
will do misaligned loads if you're not careful).
More information about the Gcc-bugs
mailing list