Tool/software: TI C/C++ Compiler
CCS6.1, MSP430 compiler TI 4.3.8
Here is the piece of code:
typedef struct __attribute__((packed)) { uint8 d0[4]; uint8 d1[2]; uint32 d2[2]; uint16 SlotInfo_Start; uint32 EdBitmap[2]; uint16 SlotInfo_SlotNum; ChannelIdT F0Channel; }RfMsgDGroupEdInfoWithSlotsT; RfMsgDGroupEdInfoWithSlotsT* groupEdInfoMsgP2 = (RfMsgDGroupEdInfoWithSlotsT*)groupEdInfoMsgP; uint32 EdBitmap[2]; EdBitmap[0] = groupEdInfoMsgP2->EdBitmap[0]; EdBitmap[1] = groupEdInfoMsgP2->EdBitmap[1];
The compiler will generate complex code to copy EdBitmap[0] and EdBitmap[1] as following. But actually groupEdInfoMsgP2 points to an address that is 4 byte aligned in my code. Can I
specify to the compiler that groupEdInfoMsgP2 is 4 byte aligned (so member EdBitmap[2] in the structure is also 4 byte aligned), so that copying to EdBitmap[2] could be much faster?