Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 31818

Summary: gcc 3.3.1 and 3.3.2 suffer internal compiler error in pre_insert_copy_insn gcse.c:5321 when using -minline-all-stringops
Product: Gentoo Linux Reporter: Ian Peters <nospamplease>
Component: [OLD] GCC PortingAssignee: Please assign to toolchain <gcc-porting>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Script of failed arj emerge

Description Ian Peters 2003-10-23 07:30:05 UTC
I have compiled my brand new system, from stage 1, with CFLAGS="-march=pentium4
-O3 -pipe -msse2 -mfpmath=sse -minline-all-stringops
-maccumulate-outgoing-args". This was successful.

I then emerged many packages. Some of these suffered  from the error described
in the summary. A typical error message is (when emerging arj):
arjdata.c:322: internal compiler error: in pre_insert_copy_insn, at gcse.c:5321

I was using gcc 3.3.1. I upgraded to 3.3.2 to attempt to fix it, but no change
(except the line number in the error message - 5321 is the 3.3.2 message).

Packages suffering from this include arj, curl, ghostscript, geotrace.

I played with many combinations of the arguments in my CFLAGS, including -O2
instead of -O3, not using -march, not speciying sse. Ultimately, I found that
the -minline-all-stringops, when combined with -march=pentium4 is the argument
which causes this problem. As a workaround I removed -minline-all-stringops from
my CFLAGS.

I guess you will want to elevate this to the gcc guys.

Reproducible: Always
Steps to Reproduce:
1.Using gcc 3.3.1 or 3.3.2 (compiled with CFLAGS specified in details)
2.CFLAGS="-maarch=pentium4 -minline-all-stringops" emerge arj
3.

Actual Results:  
Suffered an internal compiler error in pre_insert_copy_insn at gcse.c

Expected Results:  
Compiled successfully.

TO BE INSERTED
Comment 1 Ian Peters 2003-10-23 07:41:33 UTC
Created attachment 19672 [details]
Script of failed arj emerge
Comment 2 Ian Peters 2003-10-23 07:42:25 UTC
bash-2.05b# emerge --info
Portage 2.0.49-r13-2 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r1, 2.6.0-test7-bk3)
=================================================================
System uname: 2.6.0-test7-bk3 i686 Mobile Intel(R) Pentium(R) 4 - M CPU 1.80GHz
Gentoo Base System version 1.4.3.10
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium4 -O3 -pipe -mfpmath=sse -msse2 -maccumulate-outgoing-args
-minline-all-stringops
"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/share/config
/usr/X11R6/lib/
X11/xkb /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
/usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-march=pentium4 -O3 -pipe -mfpmath=sse -msse2 -maccumulate-outgoing-args
-minline-all-stringo
ps"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache notitles -sandbox"
GENTOO_MIRRORS="http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ http://ftp.mirror.ac.uk/sites/www.
ibiblio.org/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.uk.gentoo.org/gentoo-portage"
USE="x86 oss foomaticdb gnome libg++ mikmod nls sdl xv slang nas acpi -afs
-alsa -apm apache2 arts -atl
as avi berkdb bonobo -kanna cdr -cjk crypt cscope cups curl dga directfb
doc -dvb dvd dvdr encode esd e
thereal evo fbcon freetds -freewnn gd gdbm gif -gphoto2 gpm gps gtk gtk2
guile imlib ipv6 -jack jikes -
joystick jpeg junit kde ldap libwww mad -matrox mbox -mcal mmx motif mozilla
mpeg mpi mysql ncurses noc
d odbc oggvorbis opengl pam pcmcia ppds pdflib perl plotutils png pnp python
qt quicktime readline samb
a sasl snmp spell sse ssl svga tcltk tcpd tetex tiff truetype trusted usb
videos wavelan wmf X xml xml2
 xmms zlib"

Comment 3 Joshua Kinard gentoo-dev 2003-10-23 08:37:02 UTC
I recommend trying to rebuild everything and change to using -march=pentium3.
 I believe there was some discussion awhile ago about gcc producing bad code
for -march=pentium4 and using sse2 or something.  Search the gentoo-dev ML
archives on marc.theaimsgroup.com to discover more on that specific issue.
 That may be the cause of your problem, but I'm not entirely sure.
Comment 4 Ian Peters 2003-10-25 09:05:06 UTC
Apparently that issue has been fixed in the 3.3.x series of gcc - it occurred
in 3.2.x. I checked that during the stage1 build, as the /etc/make.conf warned
about it. I am using gcc 3.3.2 now, and compiled both it, and 3.3.1 with
3.3.1, so I don't think this is the reason. Although I suppose it may.
Comment 5 Marc Doughty 2003-10-30 18:20:12 UTC
From personal experience, the advantages of using flags like -minline-all-stringops
is nothing but trouble. The reason they're not automatically turned on by
-O3 is bacause they're not stable or not safe. It's not a 'problem' with
GCC any more than it's AMD's problem if you overclock a CPU and get crashes.



Remember, gcc-3.2 was actually gcc-3.1, but they broke the ABI so they decided
to version-bump the title. That means the gcc-3.2 codebase is considerably
older than it 'feels'.

Pentium4 support seems to be proper in GCC-3.3. I have two systems built
from stage-1 with gcc-3.3.2-r1 and it seems better than any previous release.
Comment 6 Martin Holzer (RETIRED) gentoo-dev 2003-12-07 17:36:24 UTC
see comment #2

*** This bug has been marked as a duplicate of 31049 ***