On Mon, Jun 27, 2005 at 10:11:50AM -0400, James Lemke wrote: > I have a situation where a structure is not properly aligned and I want > to copy it to fix this. > > I'm aware that -no-builtin-memcpy will suppress the expansion of > memcpy() (force library calls) for a whole module. Is it possible to > suppress the expansion for a single invocation?
You can: #include <string.h> ... extern __typeof(memcpy) my_memcpy __asm ("memcpy"); and use my_memcpy instead of memcpy in the place where you want to force library call. Or you can use memcpy builtin, just tell GCC it should forget everything it knows about alignment of whatever you know is not aligned. void *psrc = (void *) src; __asm ("" : "+r" (psrc)); memcpy (dest, psrc, len); Jakub