Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 57602 - sse2 is broken in gcc-3.4
Summary: sse2 is broken in gcc-3.4
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GCC Porting (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Jeremy Huddleston (RETIRED)
URL: http://forums.gentoo.org/viewtopic.ph...
Whiteboard:
Keywords:
: 61999 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-07-19 09:02 UTC by Patrick Dawson (RETIRED)
Modified: 2005-01-16 20:27 UTC (History)
5 users (show)

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 Patrick Dawson (RETIRED) gentoo-dev 2004-07-19 09:02:34 UTC
As you can see in the Gentoo forums thread (see URL above), several users have been experiencing frequent and easily reproducible crashes of the X server with the combination of xorg-x11, gcc-3.4, march=pentium4, and the nvidia driver.
Changing march=pentium4 to march=pentium3 eliminates at least some of the crashes.

I recommend adding something like this to the ebuild:

if [ "`gcc-major-version`" -eq "3" -a "`gcc-minor-version`" -eq "4" ]
then
	replace-cpu-flags "pentium3" "pentium4"
fi



Reproducible: Always
Steps to Reproduce:
1. CFLAGS="-O2 -march=pentium4" emerge xorg-x11
2. echo "startkde" >> ~/.xinitrc
3. startx

Actual Results:  
xorg-x11 crashes shortly after displaying the KDE splash screen.

Expected Results:  
KDE should start normally.

Portage 2.0.51_pre13 (default-x86-2004.0, gcc-3.4.1, glibc-2.3.4.20040619-r0,
2.6.7 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz)
=================================================================
System uname: 2.6.7 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz
Gentoo Base System version 1.5.1
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.14.90.0.8-r1
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.2/share/config /usr/kde/3/share/config /usr/share/config
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/
http://mirror.datapipe.net/gentoo http://mirror.datapipe.net/gentoo
http://open-systems.ufl.edu/mirrors/gentoo http://gentoo.mirrored.ca/
http://mirrors.acm.cs.rpi.edu/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://192.168.1.100/portage"
USE="X X509 aac acpi aim alsa apache2 apm arts audiofile avi berkdb cdr crypt
cups dga divx4linux dvd encode esd fbcon flac foomaticdb freetype gcj gdbm gif
gimp gnome gpm gtk gtk2 guile icq imlib inetd jack java jikes jpeg junit kde
libg++ libwww mad mikmod mmx mng motif mpeg mpeg4 mplayer ncurses nls oggvorbis
opengl oscar oss pam pdflib perl png python qt quicktime readline samba sdl
slang sndfile speex spell sse ssl svg svga tcltk tcpd theora tiff truetype usb
v4l v4l2 wmf x86 xml xml2 xmms xv xvid zlib"
Comment 1 Matan Peled 2004-07-22 08:53:47 UTC
Confirming...

Portage 2.0.50-r9 (default-x86-2004.2, gcc-3.4.1, glibc-2.3.4.20040619-r0, 2.6.8-rc2-love2)
=================================================================
System uname: 2.6.8-rc2-love2 i686 Intel(R) Pentium(R) 4 CPU 2.60GHz
Gentoo Base System version 1.4.16
distcc 2.13 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.3 [enabled]
Autoconf: sys-devel/autoconf-2.59-r3
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium4 -O3 -ftracer -fPIC -ffast-math -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/alias /var/qmail/control /var/vpopmail/domains /var/vpopmail/etc"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=pentium4 -O3 -ftracer -fPIC -ffast-math -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs buildpkg ccache sandbox usersandbox"
GENTOO_MIRRORS="http://mirror.hamakor.org.il/pub/mirrors/gentoo/ http://gentoo.mirror.sdv.fr http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /usr/local/trunk /usr/local/bmg-main"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X Xaw3d aalib acpi alsa apache2 apm arts avi berkdb caps cdr crypt cups directfb divx4linux doc encode erandom esd ethereal fam flac foomaticdb gd gdbm gif gimp gimpprint gnome gnomedb gpm gtk gtk2 icq imagemagick imap imlib imlib2 ipv6 jack jpeg k3b lcms libg++ libwww mad memlimit mikmod mmx mng motif mozdomi mozilla mozsvg mpeg mplayer mule mysql ncurses nls nocd nptl ntlm oggvorbis openal opengl oscar pam pdflib perl pic png ppds propolice pthreads python qt quicktime readline samba sdl slang snmp speedo speex spell src sse ssl svg svga tcltk tcpd tetex theora truetype unicode videos vim-with-x wifi x86 xml xml2 xmms xosd xv xvid zlib"

Both xorg-x11-6.7.0-r1 & -r2.
Comment 2 Joe Kappus 2004-08-01 13:39:23 UTC
I confirm this, and know 2 other cases in which this made xorg finally not segfault.
Comment 3 Ernst Sjöstrand 2004-08-10 16:14:51 UTC
I have something like this on my AMD 64 (in i386 mode).
Compling with GCC 3.4 and CFLAGS="-O3 -pipe -march=k8 -fomit-frame-pointer -ftracer" made X very unstable.
I have not seen any problems with those flags earlier.
Anyway, I know it's a bit dangerous cflags, so I remerged xorg with CFLAGS="-pipe" just to be sure. Didn't help!
Switched back to GCC 3.3.4 and compiled with CFLAGS="-O3 -pipe -march=athlon-xp -fomit-frame-pointer", working great now.

Is this related?
Comment 4 Robin Smidsrød 2004-08-19 00:06:45 UTC
It seems like it doesn't like -march=pentium-m either.

Changed it to -march=pentium3 and now it works. That is, it doesn't segfault when I click some icons.

I guess it has some problems with SSE2 optimizations, since that is basically the difference between P-3 and P-M.
Comment 5 Colin Macdonald 2004-08-27 14:18:23 UTC
is this a dup of bug #60597?
Comment 6 Robin Smidsrød 2004-08-27 14:55:45 UTC
I wouldn't quite call it a dup, but it touches much of the same problems. But PentiumM wasn't mentioned in the other bugreport, for one.
Comment 7 Patrick Dawson (RETIRED) gentoo-dev 2004-08-28 08:20:19 UTC
No. The xorg-x11 ebuild only changes flags for gcc-3.2.x, not gcc-3.4.x.
Comment 8 SpanKY gentoo-dev 2004-09-09 22:33:07 UTC
*** Bug 61999 has been marked as a duplicate of this bug. ***
Comment 9 SpanKY gentoo-dev 2004-09-09 22:35:26 UTC
ive been using -mno-sse2 for a while now on my box to fix things

x11 team: can we at least get something like this added to the xorg ebuild ?
[ "$(gcc-version)" == "3.4" ] && test_flag -mno-sse2 && append-flags -mno-sse2
Comment 10 Joe Kappus 2004-09-11 17:56:12 UTC
I wanna update, that this affects gcc-3.4.2, xorg-6.8.0, and all cvs versions of xorg in between 6.7.0 and 6.8.0.  I recommend that the fix for -march=pentium3 be added to all xorg ebuilds, as it appears that xorg's devs are not going to fix this because it involves the nvidia binary driver.
Comment 11 Robin Smidsrød 2004-09-12 04:26:12 UTC
Shouldn't this be filed upstream to Nvidia, so they can fix the problem? They probably know where to look...
Comment 12 Patrick Dawson (RETIRED) gentoo-dev 2004-09-12 08:43:22 UTC
>> Shouldn't this be filed upstream to Nvidia, so they can fix the problem? <<

I don't think so. I remember experiencing segfaults using the nv driver, though not quite as frequently as with the nvidia driver. In any case, we really should do the proposed "quick fix" soon. It doesn't hurt much, and there's been talk of unmasking gcc-3.4 on x86 soon. This problem would affect a significant number of users. I'll try the -mno-sse with 6.8.0 today and let you know what happens.
Comment 13 Disenchanted (RETIRED) gentoo-dev 2004-09-12 17:28:00 UTC
appending -mno-sse2 for now with gcc3.4
Comment 14 Disenchanted (RETIRED) gentoo-dev 2004-09-12 17:29:00 UTC
did i mention please wait 35 minutes, sync, and test?

thanks

Comment 15 SpanKY gentoo-dev 2004-09-12 19:50:50 UTC
the bit of code you added to append -mno-sse2 is wrong ... it's breaks all arches that dont support the flag (so currently mips and ppc are broken)

why not use the code i originally suggested in Comment #9
Comment 16 Donnie Berkholz (RETIRED) gentoo-dev 2004-09-30 14:15:53 UTC
Assigning back to gcc people to get the real problem fixed, now that X11 has a workaround.
Comment 17 Ervin Németh 2004-10-18 03:01:51 UTC
The "patch" disables sse2 to the entire xorg-x11, because the nvidia driver is buggy? What about people who don't use nvidia cards?

Please write a patch that rewrites the nvidia driver's Imakefile.
Comment 18 Donnie Berkholz (RETIRED) gentoo-dev 2004-10-18 08:34:56 UTC
Please attach such a patch. I'll add it and see how things go.
Comment 19 Paul de Vrieze (RETIRED) gentoo-dev 2004-10-19 07:21:23 UTC
I had issues with the sse2 compiled version when not using nvidia drivers at all (but ati). Those were fixed by disabling the sse2 code generation, so I seriously doubt that the problem is nvidia only.
Comment 20 Jeremy Huddleston (RETIRED) gentoo-dev 2005-01-10 04:23:20 UTC
This has been fixed upstream as of about a month ago... I'll put together a newer 3.4 ebuild containing the fix tomorrow...

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19010
Comment 21 Jeremy Huddleston (RETIRED) gentoo-dev 2005-01-11 00:52:28 UTC
Please test gcc-3.4.3.20050110
Comment 22 Jeremy Huddleston (RETIRED) gentoo-dev 2005-01-11 00:59:11 UTC
oh, and if testing off of cvs, make sure to 'cvs up' in eclass first.
Comment 23 Jeremy Huddleston (RETIRED) gentoo-dev 2005-01-16 20:27:59 UTC
This is reportedly fixed in >=gcc-3.4.3.20050110.