Subject: bin/9369: -current gcc chokes on Mozilla M13
To: None <gnats-bugs@gnats.netbsd.org>
From: None <hauke@Espresso.Rhein-Neckar.DE>
List: netbsd-bugs
Date: 02/07/2000 12:45:54
>Number:         9369
>Category:       bin
>Synopsis:       m68k gcc chokes on building Mozilla M13 sources.
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb  7 12:45:01 2000
>Last-Modified:
>Originator:     Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
>Organization:
Einzeln auftretender Radfahrer
>Release:        -current of 01 Feb 2000
>Environment:
	
System: NetBSD q700.hf.org 1.4Q NetBSD 1.4Q (FG54) #43: Fri Jan 28 23:54:18 CET 2000 hauke@q700.hf.org:/usr/src/sys/arch/mac68k/compile/FG54 mac68k


>Description:
	During a build of Mozilla M13 on NetBSD/mac68k, gcc 
	dies with an internal error - apparently it chokes on its 
	own intermediate code.
	The NetBSD/mac68k installation is bleeding-edge -current, although 
	I saw the same error on Oct 99 binaries.

[...]

cd misc; gmake export
gmake[4]: Entering directory
	`/home/hauke/src/Mozilla/mozilla/nsprpub/pr/src/misc'
gcc -o NetBSD1.4Q_DBG.OBJ/prnetdb.o -c  -g -fPIC  -ansi -Wall -pipe
-DNETBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK -DFORCE_PR_LOG -DXP_UNIX -DDEBUG
-UNDEBUG -DDEBUG_hauke -D_PR_LOCAL_THREADS_ONLY -D_NSPR_BUILD_
-I/home/hauke/src/Mozilla/mozilla/dist/include -I../../../pr/include
-I../../../pr/include/private  prnetdb.c
prnetdb.c: In function `PR_ntohll':
prnetdb.c:1102: internal error--unrecognizable insn:
(insn 12 10 13 (set (mem:DI (plus:SI (reg:SI 14 a6)
                (const_int -8)))
        (ashiftrt:DI (mem:DI (plus:SI (reg:SI 14 a6)
                    (const_int 8)))
            (const_int 32))) -1 (nil)
    (nil))
/usr/src/gnu/usr.bin/egcs/common/../../../dist/gcc/toplev.c:1367: Internal
compiler error in function fatal_insn
gmake[4]: *** [NetBSD1.4Q_DBG.OBJ/prnetdb.o] Error 1
gmake[4]: Leaving directory
	`/home/hauke/src/Mozilla/mozilla/nsprpub/pr/src/misc'


	prnetdb.c line 1102 is the last line of the function

PR_IMPLEMENT(PRUint64) PR_ntohll(PRUint64 n)
{
    /*
    ** There is currently no attempt to optomize out depending
    ** on the host' byte order. That would be easy enough to
    ** do.
    */
    PRUint64 tmp;
    PRUint32 hi, lo;
    LL_L2UI(lo, n);
    LL_SHR(tmp, n, 32);
    LL_L2UI(hi, tmp);
    hi = PR_ntohl(hi);
    lo = PR_ntohl(lo);
    LL_UI2L(n, hi);
    LL_SHL(n, n, 32);
    LL_UI2L(tmp, lo);
    LL_ADD(n, n, tmp);
    return n;
}  /* ntohll */


	which after preprocessing looks like


PRUint64   PR_ntohll(PRUint64 n)
{
    PRUint64 tmp;
    PRUint32 hi, lo;
    (( lo ) = (PRUint32)(  n )) ;
    (( tmp ) = (PRInt64)(  n ) >> (  32 )) ;
    (( hi ) = (PRUint32)(  tmp )) ;
    hi = PR_ntohl(hi);
    lo = PR_ntohl(lo);
    (( n ) = (PRInt64)(  hi )) ;
    (( n ) = (PRInt64)(  n ) << (  32 )) ;
    (( tmp ) = (PRInt64)(  lo )) ;
    (( n ) = (  n ) + (  tmp )) ;
    return n;
}


	-- nothing special here. "gcc -S" then fails with 
	the listed message.

>How-To-Repeat:
	Get the Mozilla M13 source tarball from www.mozilla.org 
	and all the associated stuff that is needed for a build 
	(gmake, gtk+, glib, ORBit, pth-current from the package collection) 
	and slap it on a m68k machine. 
	Configure, make and watch the build fail with a gcc internal error.

>Fix:
	Unknown.

>Audit-Trail:
>Unformatted: