inline memcpy bug
Martin Kahlert
martin.kahlert@infineon.com
Thu Jun 13 01:40:00 GMT 2002
Hi!
IIRC, some short time before the 3.1 release there was some change of the
mem* inline routines for x86.
Maybe this one crept in at that time, but i cannot test this.
$ cat bug.c
#include <string.h>
int main()
{
char dst[16];
char src[16];
int tocopy = 5;
memcpy (dst+5, src, tocopy);
return 0;
}
$ gcc -O -minline-all-stringops -o bug bug.c
$ ./bug
$ Segmentation fault
$ gcc -v
Reading specs from /sw/snapshots/lib/gcc-lib/i686-pc-linux-gnu/3.1.1/specs
Configured with: ../gcc-20020610/configure --prefix=/sw/snapshots --enable-languages=f77,c++,java \
--disable-threads --enable-shared=libstdc++
Thread model: single
gcc version 3.1.1 20020610 (prerelease)
Bye,
Martin.
--
The early bird catches the worm. If you want something else for
breakfast, get up later.
More information about the Gcc
mailing list