Hi,

Comiling the following code snippet with


  gcc -v -save-temps -Wall -O2 -march=i486 -m3dnow -fprefetch-loop-arrays -o
gcc-bug.o gcc-bug.c
causes gcc to abort with an internal compiler error:
<----------------------------- SNIP ----------------------------->
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/specs
Configured with:
/var/tmp/portage/gcc-3.3.4-r1/work/gcc-3.3.4/configure --prefix=/usr --bindi
r=/usr/i686-pc-linux-gnu/gcc-bin/3.3 --includedir=/usr/lib/gcc-lib/i686-pc-l
inux-gnu/3.3.4/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3 -
-mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3/man --infodir=/usr/share/g
cc-data/i686-pc-linux-gnu/3.3/info --enable-shared --host=i686-pc-linux-gnu 
--target=i686-pc-linux-gnu --with-system-zlib --enable-languages=c,c++ --ena
ble-threads=posix --enable-long-long --disable-checking --disable-libunwind-
exceptions --enable-cstdio=stdio --enable-version-specific-runtime-libs --wi
th-gxx-include-dir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/include/g++-v3 -
-with-local-prefix=/usr/local --enable-shared --enable-nls --without-include
d-gettext --disable-multilib --enable-__cxa_atexit --enable-clocale=generic
Thread model: posix
gcc version 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6)

/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/cc1 -E -quiet -v -D__GNUC__=3 -D__G
NUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=4
gcc-bug.c -march=i486 -m3dnow -Wall -fprefetch-loop-arrays -O2 gcc-bug.i
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/include
 /usr/include
End of search list.
 /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/cc1 -fpreprocessed
gcc-bug.i -quiet -dumpbase gcc-bug.c -march=i486 -m3dnow -auxbase
gcc-bug -O2 -Wall -version -fprefetch-loop-arrays -o gcc-bug.s
GNU C version 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6)
(i686-pc-linux-gnu)
        compiled by GNU C version 3.3.4 20040623 (Gentoo Linux 3.3.4-r1,
ssp-3.3.2-2, pie-8.7.6).
GGC heuristics: --param ggc-min-expand=60 --param ggc-min-heapsize=56460
gcc-bug.c: In function `main':
gcc-bug.c:14: internal compiler error: Floating point exception
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugs.gentoo.org/> for instructions.
Preprocessed source stored into /tmp/ccvFaBQH.out file, please attach this
to your bugreport.
<----------------------------- SNIP END ----------------------------->

The code was (gcc-bug.i won't differ much):
<----------------------------- SNIP ----------------------------->
/**
 * Compile with: gcc -Wall -O2 -march=i486 -m3dnow -fprefetch-loop-arrays -o
gcc-bug.o gcc-bug.c
 */

int
main(int argc, char **argv)
{
  int *table;

  for (;;)
    *table++ = 10;

  return 0;
}
<----------------------------- SNIP END ----------------------------->

This only happens with the above combination of flags (important is the
option --prefetch-loop-arrays). You can also use i586 or c3 or O3 instead of
O2.
The code provided here can be found in a more complex way in some other
software packages (e.g. lame) which caused this error originally.

Greetings
Philipp Hasse

Reply via email to