This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: linux-2.3.3 doesn't boot when compiled with egcs-2.93.22
martin@mira.isdn.cs.tu-berlin.de (Martin v. Loewis) writes:
> > The only portable way to write memcpy is with `char*'; you can access
> > anything through a pointer-to-character. But, to make it fast, you
> > probably have to write it in assembly code.
>
> That's what I first thought, but it doesn't solve the problem
> completely.
>
> The idea behind constant_memcpy is to have the compiler emit
> integer-moves for small amounts of data, and only use the x86 string
> operations for larger pieces of memory.
>
> Now, that *could* be changed to use assembler code for the small
> structures as well, but then you'd lose optimization opportunities.
> AFAIK, you'd have to say that the asm changes "memory", whereas you
> clearly know that it changes *to.
Another way is to fix __builtin_memcpy that it does the same stuff
as the Linux version, and then #ifdef out the string.h version for an appropiate
compiler version.
I guess it wouldn't be that hard.
-Andi
--
This is like TV. I don't like TV.