Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 21748 - SpiderMonkey (Mozilla JavaScript) fails to compile under Pentium 4 CFLAGS
Summary: SpiderMonkey (Mozilla JavaScript) fails to compile under Pentium 4 CFLAGS
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: SpanKY
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-27 01:58 UTC by Zhen Lin
Modified: 2003-06-23 12:54 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zhen Lin 2003-05-27 01:58:02 UTC
GCC gets confused (literally) trying to optimize SpiderMonkey under
"-march=pentium4 -O2 -pipe -fomit-frame-pointer -mfpmath=sse"

Filtering -march=pentium4 into -march=pentium3 solves the problem.
Comment 1 SpanKY gentoo-dev 2003-06-17 22:02:36 UTC
works for me over here ... could you provide `emerge info` ? 
 
root@vapier spidermonkey-1.5_rc5 # pwd 
/var/db/pkg/dev-lang/spidermonkey-1.5_rc5 
root@vapier spidermonkey-1.5_rc5 # cat CFLAGS  
-march=pentium4 -O2 -pipe -fomit-frame-pointer -mfpmath=sse -pipe 
root@vapier spidermonkey-1.5_rc5 # cat CXXFLAGS  
-march=pentium4 -O2 -pipe -fomit-frame-pointer -mfpmath=sse -pipe 
root@vapier spidermonkey-1.5_rc5 # gcc -v 
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/specs 
Configured with: /var/tmp/portage/gcc-3.2.3-r1/work/gcc-3.2.3/configure --prefix=/usr 
--bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.2 
--includedir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/include 
--datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.2 
--mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.2/man 
--infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.2/info --enable-shared 
--host=i686-pc-linux-gnu --target=i686-pc-linux-gnu --with-system-zlib 
--enable-languages=c,c++,ada,f77,objc,java --enable-threads=posix --enable-long-long 
--disable-checking --enable-cstdio=stdio --enable-clocale=generic --enable-__cxa_atexit 
--enable-version-specific-runtime-libs 
--with-gxx-include-dir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/include/g++-v3 
--with-local-prefix=/usr/local --enable-shared --disable-nls 
Thread model: posix 
gcc version 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r1, propolice) 
Comment 2 Zhen Lin 2003-06-18 02:53:31 UTC
Portage 2.0.48-r1 (default-x86-1.4, gcc-3.2.2, glibc-2.3.1-r4)
=================================================================
System uname: 2.4.20-gentoo-r5 i686 Intel(R) Pentium(R) 4 CPU 1500MHz
GENTOO_MIRRORS="http://karl.planetmirror.com/pub/gentoo/ http://gentoo.gnukorea.org/ http://chaos.planetmirror.com/pub/gentoo/ http://www.zentek-international.com/mirrors/gentoo/ http://maxwell.mirror.ac.uk/sites/www.ibiblio.org/gentoo/ http://chandra.mirror.ac.uk/sites/www.ibiblio.org/gentoo/"
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/share/config /var/bind /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config /usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
PORTDIR="/usr/portage"
DISTDIR="/usr/portage/distfiles"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR_OVERLAY="/usr/portage.local"
USE="x86 oss apm avi crypt cups encode gif jpeg libg++ mikmod mmx mpeg ncurses nls pdflib png quicktime spell truetype xml2 xmms xv zlib gtkhtml alsa gdbm berkdb slang readline tetex bonobo svga tcltk java guile mysql X sdl gpm tcpd pam libwww ssl perl python esd imlib oggvorbis gnome gtk motif opengl mozilla gphoto2 ldap cdr cjk dga gb jikes kerberos krb4 mbox mule odbc pic samba sse tiff usb -3dnow -arts -qt -kde"
COMPILER="gcc3"
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer -mfpmath=sse"
CXXFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer -mfpmath=sse"
ACCEPT_KEYWORDS="x86"
MAKEOPTS="-j2"
AUTOCLEAN="yes"
SYNC="rsync://rsync.asia.gentoo.org/gentoo-portage"
FEATURES="sandbox ccache userpriv usersandbox"

Unfortunately, I've recompiled GCC since then, but I assume my GCC is -march=pentium4 -O{2,3,s} -pipe -fomit-frame-pointer [-mfpmath=sse] , before filtering. The error was in a LISP like syntax....

gcc -o Linux_All_OPT.OBJ/jsdtoa.o -c -march=pentium4 -O2 -pipe -fomit-frame-pointer -mfpmath=sse -Wall -Wno-format -O -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DHAVE_LOCALTIME_R -DX86_LINUX  -UDEBUG -DNDEBUG -UDEBUG_portage -DEDITLINE -ILinux_All_OPT.OBJ  -Wall -Wno-format -O -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DHAVE_LOCALTIME_R -DX86_LINUX  -UDEBUG -DNDEBUG -UDEBUG_portage -DEDITLINE -ILinux_All_OPT.OBJ  jsdtoa.c
jsdtoa.c: In function `ulp':
jsdtoa.c:987: warning: `a' might be used uninitialized in this function
jsdtoa.c: In function `b2d':
jsdtoa.c:1018: warning: `d' might be used uninitialized in this function
jsdtoa.c: In function `JS_strtod':
jsdtoa.c:1239: warning: `rv0' might be used uninitialized in this function
jsdtoa.c:1874: unable to find a register to spill in class `AREG'
jsdtoa.c:1874: this is the insn:
(insn 1757 1756 1758 (set (reg:CCNO 17 flags)
        (compare:CCNO (and:SI (subreg:SI (reg/v:DI 21 rxmm0 [243]) 0)
                (const_int 1 [0x1]))
            (const_int 0 [0x0]))) 281 {testsi_1} (insn_list 1753 (nil))
    (expr_list:REG_DEAD (reg/v:DI 21 rxmm0 [243])
        (nil)))
Comment 3 SpanKY gentoo-dev 2003-06-18 07:03:22 UTC
so are you saying the bug doesnt occur anymore ?

if so it may have been an over optimization in gcc itself ...
Comment 4 Zhen Lin 2003-06-18 07:06:36 UTC
No, I just got the error again, as shown previously.

My current gcc -v :
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/specs
Configured with: /var/tmp/portage/gcc-3.2.2/work/gcc-3.2.2/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.2 --includedir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.2 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.2/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.2/info --enable-shared --host=i686-pc-linux-gnu --target=i686-pc-linux-gnu --with-system-zlib --enable-languages=c,c++,ada,f77,objc,java --enable-threads=posix --enable-long-long --disable-checking --enable-cstdio=stdio --enable-clocale=generic --enable-__cxa_atexit --enable-version-specific-runtime-libs --with-gxx-include-dir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/include/g++-v3 --with-local-prefix=/usr/local --enable-shared --enable-nls --without-included-gettext
Thread model: posix
gcc version 3.2.2

was compiled with -march=pentium3 -mcpu=pentium4 -pipe

Comment 5 SpanKY gentoo-dev 2003-06-18 12:24:06 UTC
to see what any pkg on your system was compiled with you can just look at
/var/db/pkg/<category>/<pkgname>-<version>/CFLAGS
Comment 6 Zhen Lin 2003-06-19 01:27:32 UTC
I know that, but the old CFLAGS file has been erased for about a week now. 

What did you compile your GCC under? 
Comment 7 SpanKY gentoo-dev 2003-06-23 12:54:15 UTC
ok i just emerged 3.2.2 and i got the bug you have ...
guess it was fixed in 3.2.3 ;)

http://cvs.gentoo.org/cgi-bin/viewcvs.cgi/gentoo-x86/dev-lang/spidermonkey/spidermonkey-1.5_rc5.ebuild.diff?r1=1.1&r2=1.2