The problem is most likely unaligned data. If you have a data structure
which has 32-bit data on a non-32-bit memory boundary then the Unaligned
access error can be reported by many RISC cpu's. The same goes for any data
size > 8 bits. 16-bit data must be 16-bit aligned, 32-bit data must be
32-bit aligned, etc.
Usually, the compiler will take care of the alignment stuff for you when you
create your data structures. But some programmers use the equivalent to
#pragma pack(1) which forces the compiler to pack all data and keeps the
compiler from aligning the data as needed by the CPU. My first thought is
to find all of the pack pragma's and remove them if you can. If you can't
remove them then change your data structures so that all data is properly
aligned.
By using the -misalign option, you are slowing down your code tremendously.
Every data access that is > 8 bits is being accessed as separate 8 bit
values. So a 32-bit access is being broken down by the compiler into 4
8-bit accesses. So even though that helps, you don't want to do that if you
can fix it.
Russ