Segher Boessenkool <segher at gcc dot> changed:

           What    |Removed                     |Added
             Status|WAITING                     |RESOLVED
         Resolution|---                         |WORKSFORME

--- Comment #7 from Segher Boessenkool <segher at gcc dot> ---
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).

Reply via email to