bebbo / libnix

libnix (v4): a C link library for AmigaOS/m68k
15 stars 9 forks source link

bcopy unaligned memory access on 68000 #64

Closed BSzili closed 1 year ago

BSzili commented 1 year ago

I have some code that uses memmove to truncate a string in place, which results in an unaligned memory access (#8000003) on 68000. I created a small test case for this:

#include <string.h>
char text[40];
int main(void)
{
    memmove(text, text + 1, sizeof(text) - 1);
    return 0;
}

I build it with m68k-amigaos-gcc -noixemul -O2 -Wall -o mmtest mmtest.c so memmove gets inlined.

BSzili commented 1 year ago

The unaligned access is now gone on 68000, thanks!