[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#189702: gcc segfaults with -O -Wunreachable-code



Package: gcc-3.2
Version: 1:3.2.3-0pre8
Severity: normal

gcc segfaults sometimes on PPC when run with -O -Wunreachable-code

Attached code sample is from bison output.  Does not seem to happen
with the same version on x86.

$ uname -a
Linux ppcbox 2.4.20-ben10 #1 Sat Apr 12 23:30:36 EDT 2003 ppc unknown
unknown GNU/Linux

$ gcc -v
Reading specs from /usr/lib/gcc-lib/powerpc-linux/3.2.3/specs
Configured with: ../src/configure -v
--enable-languages=c,c++,java,f77,proto,objc,ada --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared
--with-system-zlib --enable-nls --without-included-gettext
--enable-__cxa_atexit --enable-clocale=gnu --enable-java-gc=boehm
--enable-objc-gc powerpc-linux
Thread model: posix
gcc version 3.2.3 20030407 (Debian prerelease)

$ gcc -c -O -Wunreachable-code test.c
test.c: In function `yystpcpy':
test.c:14: internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.


char * yystpcpy(char *yydest, const char *yysrc)
{
  char *yyd = yydest;
  const char *yys = yysrc;

  while ((*yyd++ = *yys++) != '\0')
      ;

  return yyd - 1;
}



Reply to: