Subject: port-alpha/22965: Building GENERIC kernel triggers in-tree GCC 3.3.1 internal compiler error
To: None <gnats-bugs@gnats.netbsd.org>
From: None <paul@chumby.dlib.vt.edu>
List: netbsd-bugs
Date: 09/26/2003 11:23:08
>Number:         22965
>Category:       port-alpha
>Synopsis:       build.sh kernel=GENERIC fails with GCC internal error
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    port-alpha-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 26 15:24:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Paul Mather
>Release:        NetBSD 1.6ZC
>Organization:
	Virginia Tech, Digital Library Research Laboratory
>Environment:
	
	
System: NetBSD chumby.dlib.vt.edu 1.6ZC NetBSD 1.6ZC (CHUMBY) #0: Thu Sep 18 12:23:33 EDT 2003 paul@chumby.dlib.vt.edu:/usr/obj/sys/arch/alpha/compile/CHUMBY alpha
Architecture: alpha
Machine: alpha
>Description:

Building a kernel on alpha with the new in-tree GCC 3.3.1 fails in
/usr/src/sys/uvm/uvm_map.h with an internal GCC compiler error:
"error: unrecognizable insn."  Due to the recent switch to GCC 3.3.1
on alpha, this means it is not currently possible to build kernels
on the alpha platform.

This error was raised even on a fresh checkout of /usr/src circa
2003-09-25.  Both /usr/tools and /usr/obj were deleted before the
build.  This problem manifested itself for me before alpha was
switched to 3.3.1, but it was possible to build kernels successfully
using the then-default GCC 2.95, so I believe this is a GCC problem on
alpha, not a kernel problem.

Here is a (truncated) log of the build.sh run:

----- Cut Here -----8<----- Cut Here -----
===> build.sh command: ./build.sh -T /usr/tools -D /home/netbsd tools kernel=GENERIC
===> build.sh started: Thu Sep 25 14:26:10 EDT 2003
===> Bootstrapping nbmake
checking for sh... /bin/sh
checking for gcc... cc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for executable suffix...
[[...]]
cc  -O -D_PATH_BSHELL="/bin/sh" -D_PATH_DEFSHELLDIR="/bin" -DHAVE_SETENV=1 -DHAVE_STRDUP=1 -DHAVE_STRERROR=1 -DHAVE_STRFTIME=1 -DHAVE_VSNPRINTF=1  -DMAKE_BOOTSTRAP -I/usr/src/tools/make/../../usr.bin/make -c /usr/src/tools/make/../../usr.bin/make/lst.lib/lstSucc.c
cc  -O -o nbmake *.o
/usr/tools/bin/nbstat: not found
/usr/src/tools/obj -> /usr/obj/tools
===> MACHINE:          alpha
===> MACHINE_ARCH:     alpha
===> TOOLDIR path:     /usr/tools
===> DESTDIR path:     /home/netbsd
===> RELEASEDIR path:  /usr/src/obj/releasedir
===> Created /usr/tools/bin/nbmake
===> makewrapper:      /usr/tools/bin/nbmake-alpha
===> Updated /usr/tools/bin/nbmake-alpha
obj ===> tools
obj ===> tools/host-mkdep
/usr/tools/bin/nbstat: not found
/usr/src/tools/host-mkdep/obj -> /usr/obj/tools/host-mkdep
obj ===> tools/compat
[[...]]
obj ===> tools/groff
/usr/tools/bin/nbstat: not found
/usr/src/tools/groff/obj -> /usr/obj/tools/groff
/usr/tools/bin/nbstat: not found
/usr/src/tools/obj -> /usr/obj/tools
cleandir ===> host-mkdep
rm -f a.out [Ee]rrs mklog core *.core     config.cache config.log config.status
host-mkdep
cleandir ===> compat
rm -r -f include
rm -f config.cache config.h
[[...]]
ln -f /usr/tools/lib/groff/refer /usr/tools/bin/nbrefer
ln -f /usr/tools/lib/groff/soelim /usr/tools/bin/nbsoelim
ln -f /usr/tools/lib/groff/tbl /usr/tools/bin/nbtbl
===> Tools built to /usr/tools
===> Building kernel:  GENERIC
===> Build directory:  /usr/src/sys/arch/alpha/compile/obj/GENERIC
rm -f a.out [Ee]rrs mklog core *.core .gdbinit
Build directory is /usr/src/sys/arch/alpha/compile/obj/GENERIC
Don't forget to run "make depend"
depending the kern library objects
[[...]]
/usr/tools/bin/alpha--netbsd-gcc  -pipe -mno-fp-regs  -ffreestanding  -pipe -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wno-sign-compare -Wno-uninitialized  -Dalpha -I.  -I/usr/src/sys/arch -I/usr/src/sys -nostdinc -DDIAGNOSTIC -DLKM -DMAXUSERS=32 -D_KERNEL-D_KERNEL_OPT   -c /usr/src/sys/uvm/uvm_loan.c
/usr/tools/bin/alpha--netbsd-gcc  -pipe -mno-fp-regs  -ffreestanding  -pipe -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wno-sign-compare -Wno-uninitialized  -Dalpha -I.  -I/usr/src/sys/arch -I/usr/src/sys -nostdinc -DDIAGNOSTIC -DLKM -DMAXUSERS=32 -D_KERNEL -D_KERNEL_OPT   -c /usr/src/sys/uvm/uvm_map.c
/usr/src/sys/uvm/uvm_map.h: In function `vm_map_lock':
/usr/src/sys/uvm/uvm_map.h:380: error: unrecognizable insn:
(insn 52 51 53 5 0x1608c5340 (set (reg:DI 18 $18)
        (symbol_ref:DI ("@Lvmmapbsy"))) -1 (nil)
    (nil))
/usr/src/sys/uvm/uvm_map.h:380: internal compiler error: in extract_insn, at recog.c:2175
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

*** Failed target:  uvm_map.o
*** Failed command: /usr/tools/bin/alpha--netbsd-gcc -pipe -mno-fp-regs -ffreestanding -pipe -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wno-sign-compare -Wno-uninitialized -Dalpha -I. -I/usr/src/sys/arch -I/usr/src/sys -nostdinc -DDIAGNOSTIC -DLKM -DMAXUSERS=32 -D_KERNEL -D_KERNEL_OPT -c /usr/src/sys/uvm/uvm_map.c
*** Error code 1

Stop.
nbmake: stopped in /usr/obj/sys/arch/alpha/compile/GENERIC

ERROR: Failed to make all in /usr/src/sys/arch/alpha/compile/obj/GENERIC
*** BUILD ABORTED ***
----- Cut Here -----8<----- Cut Here -----

This is the version of GCC used in the build.sh process:

/usr/src paul@chumby$ /usr/tools/bin/alpha--netbsd-gcc -v
Reading specs from /usr/tools/lib/gcc-lib/alpha--netbsd/3.3.1/specs
Configured with: /usr/src/tools/gcc/../../gnu/dist/gcc/configure --target=alpha--netbsd --disable-nls --enable-long-long --disable-multilib --enable-threads --program-transform-name=s,^,alpha--netbsd-, --enable-languages=c c++ objc f77 --prefix=/usr/tools --disable-shared
Thread model: posix
gcc version 3.3.1


>How-To-Repeat:

1. Checkout -CURRENT circa 2003-09-25 or thereabouts.  (This problem
has manifested itself for me at least a week or so prior to that date,
though, so I don't believe it is due to an anomalous checkout date.)

2. cd /usr/src

3. ./build.sh tools kernel=GENERIC

>Fix:

A workaround would be to revert back to GCC 2.95 as default for builds
on alpha until this GCC problem is corrected.
>Release-Note:
>Audit-Trail:
>Unformatted: