ICE while building llvm-gcc

I'm on OSX 10.5, trying to build a svn checkout of llvm-gcc. I've also
checked out llvm. Both are synced to r61075.

I'm using Apple's gcc 4.0.1:

$ gcc -v
Using built-in specs.
Target: i686-apple-darwin9
Configured with: /var/tmp/gcc/gcc-5488~2/src/configure
--disable-checking -enable-werror --prefix=/usr --mandir=/share/man
--enable-languages=c,objc,c++,obj-c++
--program-transform-name=/^[cg][^.-]*$/s/$/-4.0/
--with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib
--build=i686-apple-darwin9 --with-arch=apple --with-tune=generic
--host=i686-apple-darwin9 --target=i686-apple-darwin9
Thread model: posix
gcc version 4.0.1 (Apple Inc. build 5488)

My configure line was:
# ../src/configure
--prefix=/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install
--program-prefix=llvm-
--enable-llvm=/Users/jyasskin/src/llvm/trunk/obj/ --with-arch=nocona
--with-tune=generic --with-gxx-include-dir=/usr/include/c++/4.0.0
--build=i686-apple-darwin9 --host=i686-apple-darwin9
--target=i686-apple-darwin9 --enable-languages=c,c++

The error is:
...
test -f config.h || (rm -f stamp-h1 && make stamp-h1)
make[4]: Nothing to be done for `all'.
make[3]: Nothing to be done for `all'.
make[3]: Nothing to be done for `all'.
make[3]: Nothing to be done for `all'.
/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/./prev-gcc/xgcc
-B/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/./prev-gcc/
-B/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/i686-apple-darwin9/bin/
-c -g -O2 -mdynamic-no-pic -DIN_GCC -W -Wall -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition
-Wmissing-format-attribute -mdynamic-no-pic -DHAVE_CONFIG_H
-DGENERATOR_FILE -I. -Ibuild -I../../src/gcc -I../../src/gcc/build
-I../../src/gcc/../include -I./../intl
-I../../src/gcc/../libcpp/include -I../../src/gcc/../libdecnumber
-I../libdecnumber -I/Users/jyasskin/src/llvm/trunk/obj//include
-I/Users/jyasskin/src/llvm/trunk/src/include -DENABLE_LLVM
-I/Users/jyasskin/src/llvm/trunk/obj/../src/include -D_DEBUG
-I/opt/local/include -D_GNU_SOURCE -D__STDC_LIMIT_MACROS
-D__STDC_CONSTANT_MACROS -o build/genautomata.o
../../src/gcc/genautomata.c
Assertion failed: (UnavailablePred != 0 && "Fully available value
should be eliminated above!"), function processNonLocalLoad, file
/Users/jyasskin/src/llvm/trunk/src/lib/Transforms/Scalar/GVN.cpp, line
1108.
../../src/gcc/genautomata.c:9450: internal compiler error: Abort trap
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter&gt; for instructions.
make[3]: *** [build/genautomata.o] Error 1
make[2]: *** [all-stage2-gcc] Error 2
make[1]: *** [stage2-bubble] Error 2
make: *** [all] Error 2

Is there any other information I should send? Is this the right place
to report build failures too? Is there a particular list of known-good
revisions that I should sync to instead of head?

Thanks!
Jeffrey

hi Jeffrey,

This patch should have fixed the problem:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20081215/071210.html

Please update and try again, sorry for the breakage!

-Chris

Thanks for the quick answer! Syncing to r61112 got rid of the ICE, but
I still get the following error:

make "DESTDIR=" "RPATH_ENVVAR=DYLD_LIBRARY_PATH"
"TARGET_SUBDIR=i686-apple-darwin9"
"bindir=/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/bin"
"datadir=/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/share"
"exec_prefix=/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install"
"includedir=/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/include"
"datarootdir=/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/share"
"docdir=/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/share/doc"
"infodir=/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/info"
"htmldir=/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/share/doc"
"libdir=/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/lib"
"libexecdir=/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/libexec"
"lispdir=" "localstatedir=/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/var"
"mandir=/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/man"
"oldincludedir=/usr/include"
"prefix=/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install"
"sbindir=/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/sbin"
"sharedstatedir=/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/com"
"sysconfdir=/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/etc"
"tooldir=/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/i686-apple-darwin9"
"build_tooldir=/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/i686-apple-darwin9"
"target_alias=i686-apple-darwin9" "BISON=bison" "CC_FOR_BUILD=gcc
-m32" "CFLAGS_FOR_BUILD=-g -O2" "CXX_FOR_BUILD=g++ -m32"
"EXPECT=expect" "FLEX=flex" "INSTALL=/opt/local/bin/ginstall -c"
"INSTALL_DATA=/opt/local/bin/ginstall -c -m 644"
"INSTALL_PROGRAM=/opt/local/bin/ginstall -c"
"INSTALL_SCRIPT=/opt/local/bin/ginstall -c" "LEX=flex" "M4=gm4"
"MAKE=make" "RUNTEST=runtest" "RUNTESTFLAGS=" "SHELL=/bin/sh"
"YACC=bison -y" "`echo 'ADAFLAGS=' | sed -e s'/[^=][^=]*=$/XFOO=/'`"
"AR_FLAGS=rc" "`echo 'BOOT_ADAFLAGS=' | sed -e
s'/[^=][^=]*=$/XFOO=/'`" "BOOT_CFLAGS=-g -O2 -mdynamic-no-pic"
"BOOT_LDFLAGS=" "CFLAGS=-g -O2" "CXXFLAGS=-g -O2" "LDFLAGS="
"LIBCFLAGS=-g -O2" "LIBCXXFLAGS=-g -O2 -fno-implicit-templates"
"STAGE1_CFLAGS=-g" "STAGE1_CHECKING=--enable-checking=yes"
"STAGE1_LANGUAGES=c" "AR_FOR_TARGET=ar" "AS_FOR_TARGET=as"
"CC_FOR_TARGET=/Users/jyasskin/src/llvm-gcc-4.2/clean/obj/./gcc/xgcc
-B/Users/jyasskin/src/llvm-gcc-4.2/clean/obj/./gcc/
-B/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/i686-apple-darwin9/bin/
-B/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/i686-apple-darwin9/lib/
-isystem /Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/i686-apple-darwin9/include
-isystem /Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/i686-apple-darwin9/sys-include"
"CFLAGS_FOR_TARGET=-O2 -g -O2 " "CPPFLAGS_FOR_TARGET="
"CXX_FOR_TARGET=/Users/jyasskin/src/llvm-gcc-4.2/clean/obj/./gcc/g++
-B/Users/jyasskin/src/llvm-gcc-4.2/clean/obj/./gcc/ -nostdinc++
-L/Users/jyasskin/src/llvm-gcc-4.2/clean/obj/i686-apple-darwin9/libstdc++-v3/src
-L/Users/jyasskin/src/llvm-gcc-4.2/clean/obj/i686-apple-darwin9/libstdc++-v3/src/.libs
-B/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/i686-apple-darwin9/bin/
-B/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/i686-apple-darwin9/lib/
-isystem /Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/i686-apple-darwin9/include
-isystem /Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/i686-apple-darwin9/sys-include"
"CXXFLAGS_FOR_TARGET=-g -O2 " "DLLTOOL_FOR_TARGET=dlltool"
"GCJ_FOR_TARGET=-B/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/i686-apple-darwin9/bin/
-B/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/i686-apple-darwin9/lib/
-isystem /Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/i686-apple-darwin9/include
-isystem /Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/i686-apple-darwin9/sys-include"
"GFORTRAN_FOR_TARGET=-B/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/i686-apple-darwin9/bin/
-B/Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/i686-apple-darwin9/lib/
-isystem /Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/i686-apple-darwin9/include
-isystem /Users/jyasskin/src/llvm-gcc-4.2/trunk/obj/../install/i686-apple-darwin9/sys-include"
"LD_FOR_TARGET=/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld"
"LIPO_FOR_TARGET=lipo" "LDFLAGS_FOR_TARGET=" "LIBCFLAGS_FOR_TARGET=-O2
-g -O2 " "LIBCXXFLAGS_FOR_TARGET=-g -O2 -fno-implicit-templates"
"NM_FOR_TARGET=nm" "OBJDUMP_FOR_TARGET=objdump"
"RANLIB_FOR_TARGET=ranlib -c" "STRIP_FOR_TARGET=strip"
"WINDRES_FOR_TARGET=windres" "`echo 'LANGUAGES=' | sed -e
s'/[^=][^=]*=$/XFOO=/'`" "LEAN=false" "CONFIG_SHELL=/bin/sh"
"MAKEINFO=makeinfo --split-size=5000000 --split-size=5000000" compare
rm -f stage_current
Comparing stages 2 and 3
warning: ./cc1-checksum.o differs
warning: ./cc1plus-checksum.o differs
Bootstrap comparison failure!
./c-decl.o differs
./cp/decl.o differs
./df-core.o differs
./gcc.o differs
./i386.o differs
./stor-layout.o differs
./tree-pretty-print.o differs
./tree.o differs
make[2]: *** [compare] Error 1
make[1]: *** [stage3-bubble] Error 2
make: *** [all] Error 2

I got a very similar error (but with a few more differing .o files)
when I synced to a revision that had worked on my Linux box. This is
with just a `make`, not `make bootstrap`, so I'm surprised it's even
doing this comparison, but I also don't know how to debug it.
http://www.google.com/search?q=Bootstrap+comparison+site%3Alists.cs.uiuc.edu%2Fpipermail
doesn't find any results either.

Thanks again,
Jeffrey

Jeffrey Yasskin wrote:

Comparing stages 2 and 3
warning: ./cc1-checksum.o differs
warning: ./cc1plus-checksum.o differs
Bootstrap comparison failure!
./c-decl.o differs
./cp/decl.o differs
./df-core.o differs
./gcc.o differs
./i386.o differs
./stor-layout.o differs
./tree-pretty-print.o differs
./tree.o differs
make[2]: *** [compare] Error 1
make[1]: *** [stage3-bubble] Error 2
make: *** [all] Error 2

I've been seeing the same error today, and Anton mentioned seeing it as well on IRC. I've decided to file this as PR 3227 and cc you.

What I'm going to do is take a known good LLVM version, a known failing LLVM version, and bisect them to see where the failure was introduced.

It's possible that it could have been introduced while the GVN bug (llvm.org/PR3217, the ICE you had at the start of this thread) was around, and that will complicate the bisection...

I got a very similar error (but with a few more differing .o files)
when I synced to a revision that had worked on my Linux box. This is
with just a `make`, not `make bootstrap`, so I'm surprised it's even
doing this comparison, but I also don't know how to debug it.
Bootstrap comparison site:lists.cs.uiuc.edu/pipermail - Google Search
doesn't find any results either.

Yeah, a bootstrap build is the default these days. I'm pretty sure that's true for FSF GCC as well.

Nick

Yup. --disable-bootstrap if you want.