This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
inline memcpy bug
- From: Martin Kahlert <martin dot kahlert at infineon dot com>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 13 Jun 2002 09:57:51 +0200
- Subject: inline memcpy bug
- Reply-to: martin dot kahlert at infineon dot com
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.