Hi,

when Dmitry announced the strict align patch he stated that 'Thes forces all local data be aligned at the word boundary.'

Dispite his statement, it seems to me that the struct layout is not being changed. Instead the word access is split into two byte accesses:

With strict align:

        mov.b   #llo(11), &HartDevicesM$FieldDevices+2
        mov.b   #llo(22), &HartDevicesM$FieldDevices+3
        mov.b   #llo(33), &HartDevicesM$FieldDevices+4
        mov.b   #llo(44), &HartDevicesM$FieldDevices+5
        mov.b   #llo(55), &HartDevicesM$FieldDevices+6
        mov.b   2(r8), &HartDevicesM$FieldDevices+7
        mov.b   3(r8), &HartDevicesM$FieldDevices+8


Without

        mov.b   #llo(11), &HartDevicesM$FieldDevices+2
        mov.b   #llo(22), &HartDevicesM$FieldDevices+3
        mov.b   #llo(33), &HartDevicesM$FieldDevices+4
        mov.b   #llo(44), &HartDevicesM$FieldDevices+5
        mov.b   #llo(55), &HartDevicesM$FieldDevices+6
        mov     2(r8), &HartDevicesM$FieldDevices+7

(which is wrong code).  The struct looks like this:

   struct fielddevice {
      enum BUFFSTATES state;
      uint8_t   unid[5];
      uint16_t  originaddr;
      uint16_t  parentaddr;
      uint8_t   unansweredCmds;
      uint8_t   hopCnt;
      uint16_t  timer5;
      TOS_StatusMsg values;
   }  __attribute__ ((packed)) FieldDevices[FIELDDEVS];

Anyway to force correct alignment of words (even with patch) witout changing the source code?

Hardy

Reply via email to