https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86555

Bernd Edlinger <bernd.edlinger at hotmail dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bernd.edlinger at hotmail dot 
de

--- Comment #3 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
(In reply to Khem Raj from comment #2)
> we can avoid the problem by altering the structure, thats not an issue, but
> do you think compiler is right here by assuming to generate LDRD on a 4byte
> aligned address when it is told that architecture (-march=armv5te) its
> building for does not support 4byte aligned address for LDRD but only 8-byte
> aligned ?

the structure has to be aligned by 8 bytes. (due to the long long member)
Therefore the compiler assumes that the DIR->lock is also aligned by 8 bytes.
I do not see why lock[2] vs. lock[1] makes a difference.
If you cannot make it aligned, you need to mark the structure with
__attribute__((__packed__)) for instance.

Reply via email to