On 9/12/06, Grant Edwards <gra...@visi.com> wrote:
On 2006-09-12, Grant Edwards <gra...@visi.com> wrote:
> My program is broken because mspgcc 3.2.3 is generating
> unaligned word accesses. I'm calling memset() and memcpy()
> fill in the fields in a packed struct. Since I've requested a
> 2-byte copy/set mspgcc is optimizing some of those memset() and
> memcpy() calls into mov.w instructions, but the destination
> address isn't word aligned, so the generated code is not
> correct.
It appears to be doing the same thing for 4-byte memcpy()
operations. :(
This was noted on the list a year ago:
http://www.nabble.com/memcpy-assumes-16-bit-alignment--t712619.html
msp430-libc/src/string/bcopy.c hasn't changed since then, so the bug
is still present. The thread from last year did include a possible
replacement memcpy() from Daniel Néri.
Neil