On Mon, Sep 25, 2006 at 08:41:53AM +0800, william_lei@xxxxxxxxxx wrote: > Dear all > Could someone tell me how to modify GCC as titled?because we have met > problem while porting some middleware,which will generate some lw/sw > instruction to unaligned address,so I would modify GCC to not generate > lw/sw instructions for this pieces code. You can use gcc's __attribute__((packed)) to define a data structure that does not have any alignment gaps in it. Gcc will then use unaligned loads and stores to access this structure. This however is a kludge, for best performance you should redefine the data structures your code is working to avoid such missalignment. Otoh if the miss-alignment case is rare only then you may actually be better off by relying on the kernel's handling of this case. Ralf