Bug 26031 - emerging allegro fails in src-compile because of a floating point exception
Bug#: 26031 Product:  Gentoo Linux Version: unspecified Platform: x86
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: vapier@gentoo.org Reported By: stefan@sblbs.de
Component: Library
URL: 
Summary: emerging allegro fails in src-compile because of a floating point exception
Keywords:  
Status Whiteboard: 
Opened: 2003-08-06 03:11 0000
Description:   Opened: 2003-08-06 03:11 0000
when emerging game-launcher, allegro is a dependency. I use the following
(agressive) settings.

Portage 2.0.48-r5 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1)
=================================================================
System uname: 2.4.21 i686 Intel(R) Pentium(R) M processor 1300MHz
GENTOO_MIRRORS="ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo
http://gentoo.oregonstate.edu/ 
http://www.ibiblio.org/pub/Linux/distributions/gentoo"
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config
/usr/kde/3/share/config /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=""
USE="x86 oss avi crypt cups encode foomaticdb gif jpeg libg++ mad mikmod mmx
mpeg ncurses nls pdflib png quicktime spell truetype xml2 xmms xv zlib directfb
alsa gdbm slang readline tetex aalib nas svga tcltk java X sdl gpm tcpd pam
libwww ssl perl python esd imlib oggvorbis gnome gtk qt kde motif opengl ldap
cdr aavm acl acpi acpi4linux altcolors altivec amd apache2 ardour-ksi canna
chasen cjk clamav curl dedicated dga dnd dvd emacs ethereal faad fbcon fbdev
flash foreign-package foreign-sysvinit freewnn ggi gphoto2 gtk2 gtkhtml hbci icc
icc-pgo imap jikes junit kakasi kerberos lcms leim libgda maildir mbox mcal mng
mpi mule mupad-noscilab music nhc98 oav objc ofx openal pcmcia pic plotutils pnp
qhull ruby samba sasl scanner slp snmp socks5 sox sse tiff trusted type1 wavelan
wmf wxwindows Xaw3d xface xinerama xosd xvid -3dnow -apm -berkdb -arts"
COMPILER="gcc3"
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -O3 -pipe -mfpmath=sse,387 -mmmx -msse -msse2
-fforce-addr -fomit-frame-pointer -funroll-loops -frerun-loop-opt
-frerun-cse-after-loop -falign-functions=4 -fprefetch-loop-arrays
-fexpensive-optimizations"
CXXFLAGS="-march=pentium4 -O3 -pipe -mfpmath=sse,387 -mmmx -msse -msse2
-fforce-addr -fomit-frame-pointer -funroll-loops -frerun-loop-opt
-frerun-cse-after-loop -falign-functions=4 -fprefetch-loop-arrays
-fexpensive-optimizations"
ACCEPT_KEYWORDS="x86"
MAKEOPTS="-j2"
AUTOCLEAN="yes"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
FEATURES="sandbox ccache"

then I get ...
gcc -DHAVE_CONFIG_H -Iinclude -Iinclude/allegro -I./include -I./include/allegro
-I.  -I/usr/X11R6/include  -DALLEGRO_LIB_BUILD -mcpu=pentium -O2 -funroll-loops
-ffast-math -fomit-frame-pointer -Wall -Wno-unused -march=pentium4 -O3 -pipe
-mfpmath=sse,387 -mmmx -msse -msse2 -fforce-addr -fomit-frame-pointer
-funroll-loops -frerun-loop-opt -frerun-cse-after-loop -falign-functions=4
-fprefetch-loop-arrays -fexpensive-optimizations -fPIC -DALLEGRO_SHARED
-march=pentium4 -O3 -pipe -mfpmath=sse,387 -mmmx -msse -msse2 -fforce-addr
-fomit-frame-pointer -funroll-loops -frerun-loop-opt -frerun-cse-after-loop
-falign-functions=4 -fprefetch-loop-arrays -fexpensive-optimizations -c
./src/allegro.c -o obj/unix/shared/alleg/allegro.o
src/allegro.c: In function `install_allegro':
src/allegro.c:366: internal error: Gleitkomma-Ausnahme
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugs.gentoo.org/> for instructions.
make: *** [obj/unix/shared/alleg/allegro.o] Fehler 1
 
!!! ERROR: media-libs/allegro-4.0.3 failed.
!!! Function src_compile, Line 52, Exitcode 2
!!! (no error message)



Reproducible: Always
Steps to Reproduce:
1.(set CFLAGS and useflags as I did)
2.emerge game-launcher
3.

Actual Results:  
See above

Expected Results:  
compile

------- Comment #1 From Stefan 2003-08-06 03:17:49 0000 -------
conservative CFLAGS, namely just "-mcpu pentium3" fix the problem.

------- Comment #2 From Martin Holzer (RETIRED) 2003-08-06 12:12:43 0000 -------
from make.conf

# CRITICAL WARNINGS: ****************************************************** #
# ATHLON-4 will generate invalid SSE  instructions; use 'athlon'   instead. #
# PENTIUM4 will generate invalid SSE2 instructions; use 'pentium3' instead. #
# ************************************************************************* #

------- Comment #3 From Brandy Westcott (RETIRED) 2003-08-18 01:11:27 0000 -------
I was intrigued by this bug report and tried to compile allegro with the same 
optimizations as Stefan. With little surprise it failed. However removing 
-fprefetch-loop-arrays it compiled wonderfully. Maybe we could filter 
-fprefetch-loop-arrays. :) 

------- Comment #4 From SpanKY 2003-08-18 18:02:07 0000 -------
*** Bug 26844 has been marked as a duplicate of this bug. ***

------- Comment #5 From Albert 2003-08-19 10:12:43 0000 -------
I can confirm that simply removing -fprefetch-loop-arrays from the CFLAGS
solves 
the problem. 

------- Comment #6 From SpanKY 2003-08-20 19:39:07 0000 -------
added to cvs, thanks guys :)

------- Comment #7 From SpanKY 2003-08-21 17:24:50 0000 -------
not fixed ... this has nothing to do with the prefetch flag :) 
 
btw, azarah is *the* man 
http://bugs.gentoo.org/show_bug.cgi?id=25461#c6 

------- Comment #8 From SpanKY 2003-08-21 17:42:14 0000 -------
*now* it's fixed in cvs :) 
 
sed -i '/TARGET_ARCH=/s:=.*:=:' configure