I've been attempting for the last week or so to compile any of the GCC 4 series of compilers to run in MinGW 5.1.6 / MSYS 1.0.11 (automated installers both from Sourceforge.org) which ships with GCC version 3.4.5. The end goal is to get GCC 4.5 to install, but I haven't been able to get any of the 4.x.x compilers to build.
I've narrowed it down to a sequence of build instructions that result in some unusual behavior. The compiler executes:
build/genmodes.exe > tmp-modes.c
/bin/sh ../../gcc-4.2.4/gcc/../move-if-change tmp-modes.c insn-modes.c
echo timestamp > s-modes
gcc -c -g -fkeep-inline-functions -DIN_GCC -W -Wall -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute
-fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.2.4/gcc -I../../gcc-4.2.4/gcc/.
-I../../gcc-4.2.4/gcc/../include -I./../intl -I../../gcc-4.2.4/gcc/../libcpp/include
-I../../gcc-4.2.4/gcc/../libdecnumber -I../libdecnumber insn-modes.c -o insn-modes.o
cc1.exe: out of memory allocating 2239725803 bytes
make[3]: *** [insn-modes.o] Error 1
make[3]: Leaving directory `/home/root/gcc-4.2.4-build/gcc'
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory `/home/root/gcc-4.2.4-build'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/root/gcc-4.2.4-build'
make: *** [all] Error 2
The main problem seems to be the call to genmodes.exe. It builds a C file (insn-modes.c) that's about 2GB in size and which, as far as I can tell is filled mostly with whitespace (though there are scattered here and there the occassional line of C code). GCC 3.4.5 chokes on it and that's how the build ends. Similar behavior is exhibited in all of the versions I've tried, except 4.5, which fails for other reasons I was hoping would be cured by using an intermediate version of the compiler.
So, three questions:
- Has anybody else experienced this?
- What's causing it?
- What, if any workaround exists?
I'm trying to do this on a 64-bit Windows 7 machine.
Thanks.
Update: I've uploaded a compressed copy of two suspect files to this location. It turns out that min-insn-modes.c is also larger than it should be. The two files (over 3GB total) compress to 121KB.