Comment 10 for bug 1608882

Revision history for this message
Thomas Preud'homme (thomas-preudhomme) wrote :

Hi JiriJ,

I managed to reproduced the issue with the code you provided, thank you. It is still early in the investigation but what I can say is that the use of strb rather than strh is due to GCC not knowing the alignment of tPldRxRegSet_Test. Since the structure is packed it assumes no particular alignment and thus accessing reg2 with strh could be an unaligned access. Since the structure is volatile, it will not do such an unaligned access, even in the presence of -munaligned-access and so it breaks it into two strb. You can get an strh by adding an __atribute__ ((aligned(2))) on the declaration and definition of tPldRxRegSet_Test (ie. in another.h and another.c)

Best regards.