I'm compiling the attached source file with:
sdcc -mz80 --data-loc 0xC001 -c funcalltest.c
My SDCC version is:
mcs51/gbz80/z80/z180/ds390/pic16/pic14/TININative/ds400/hc08 3.0.5 #6899
(Oct 2 2011) (MINGW32)
After compiling, look at the generated asm or lst file and see what the compiler did with the first memcpy call. It keeps pushing some args multiple times.