Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 42493 - gcc-3.3.2-r5 - internal compiler error while trying to compile opencv computer vision library.
Summary: gcc-3.3.2-r5 - internal compiler error while trying to compile opencv compute...
Status: RESOLVED CANTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: x86 Linux
: High minor (vote)
Assignee: Please assign to toolchain
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-22 09:25 UTC by Roman Stanchak
Modified: 2004-09-23 19:11 UTC (History)
1 user (show)

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


Attachments
Preprocessed source (ccQZdz0R.out,498.88 KB, text/plain)
2004-02-22 09:27 UTC, Roman Stanchak
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Stanchak 2004-02-22 09:25:43 UTC
When I try to compile the intel opencv computer vision library, I get the following error:
/bin/sh ../../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I. -I../include -I../..    -g -mcpu=i686 -march=i686 -ffast-math -fomit-frame-pointer -O3 -DNDEBUG -Wall -fno-rtti -pipe -c -o cvfundam.lo `test -f 'cvfundam.cpp' || echo './'`cvfundam.cpp
g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I. -I../include -I../.. -g -mcpu=i686 -march=i686 -ffast-math -fomit-frame-pointer -O3 -DNDEBUG -Wall -fno-rtti -pipe -c cvfundam.cpp -MT cvfundam.lo -MD -MP -MF .deps/cvfundam.TPlo  -fPIC -DPIC -o cvfundam.lo
cvfundam.cpp: In function `int icvCubicV(double, double, double, double*)':
cvfundam.cpp:2187: internal compiler error: in emit_move_insn_1, at expr.c:3632


Reproducible: Always
Steps to Reproduce:
1. Download opencv (http://sourceforge.net/projects/opencvlibrary/)
2. ./configure ; make

Actual Results:  
source='cvfundam.cpp' object='cvfundam.lo' libtool=yes \ 
depfile='.deps/cvfundam.Plo' tmpdepfile='.deps/cvfundam.TPlo' \ 
depmode=gcc3 /bin/sh ../../depcomp \ 
/bin/sh ../../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I. 
-I../include -I../..    -g -mcpu=i686 -march=i686 -ffast-math 
-fomit-frame-pointer -O3 -DNDEBUG -Wall -fno-rtti -pipe -c -o cvfundam.lo 
`test -f 'cvfundam.cpp' || echo './'`cvfundam.cpp 
g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I. -I../include -I../.. -g -mcpu=i686 
-march=i686 -ffast-math -fomit-frame-pointer -O3 -DNDEBUG -Wall -fno-rtti 
-pipe -c cvfundam.cpp -MT cvfundam.lo -MD -MP -MF .deps/cvfundam.TPlo  -fPIC 
-DPIC -o cvfundam.lo 
cvfundam.cpp: In function `int icvCubicV(double, double, double, double*)': 
cvfundam.cpp:2187: internal compiler error: in emit_move_insn_1, at 
expr.c:3632 
Please submit a full bug report, 
with preprocessed source if appropriate. 
See <URL:http://bugs.gentoo.org/> for instructions. 
Preprocessed source stored into /tmp/ccQZdz0R.out file, please attach this to 
your bugreport 
 

Expected Results:  
compiled w/o error 

*  sys-devel/gcc 
      Latest version available: 3.3.2-r5 
      Latest version installed: 3.3.2-r5 
... 
 
Portage 2.0.50-r1 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r9, 2.4.21) 
================================================================= 
System uname: 2.4.21 i686 AMD Athlon(tm)  
Gentoo Base System version 1.4.3.13 
Autoconf: sys-devel/autoconf-2.58 
Automake: sys-devel/automake-1.7.7 
ACCEPT_KEYWORDS="x86" 
AUTOCLEAN="yes" 
CFLAGS="-mcpu=athlon-xp -O3 -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/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /var/qmail/control" 
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" 
CXXFLAGS="-O2 -mcpu=i686 -pipe" 
DISTDIR="/usr/portage/distfiles" 
FEATURES="autoaddcvs ccache sandbox" 
GENTOO_MIRRORS="http://gentoo.mirrors.pair.com/ http://gentoo.seren.com/gentoo 
http://gentoo.noved.org/" 
MAKEOPTS="-j2" 
PKGDIR="/usr/portage/packages" 
PORTAGE_TMPDIR="/var/tmp" 
PORTDIR="/usr/portage" 
PORTDIR_OVERLAY="" 
SYNC="rsync://rsync.gentoo.org/gentoo-portage" 
USE="3dnow X alsa apm arts avi berkdb bonobo cdr crypt cups directfb dvd 
encode esd foomaticdb gdbm gif gphoto2 gpm gtk gtk2 imlib java jikes jpeg kde 
libg++ libwww mad mikmod motif mpeg mysql ncurses nls oggvorbis opengl oss pam 
pdflib perl png postgres python qt quicktime readline ruby sdl slang spell ssl 
svga tcltk tcpd tetex tiff truetype usb x86 xml2 xmms xv zlib"
Comment 1 Roman Stanchak 2004-02-22 09:27:21 UTC
Created attachment 26113 [details]
Preprocessed source
Comment 2 Roman Stanchak 2004-02-22 09:37:04 UTC
The problem seems to be the -ffast-math flag, specifically -funsafe-math-optimizations.
Removing this eliminates the error.
The error has been seen on both a p4 and athlon system, and was not present on the previous version of gcc I had been using (3.2.3).
Comment 3 Martin Schlemmer (RETIRED) gentoo-dev 2004-02-23 12:16:30 UTC
And gcc-3.3.3?
Comment 4 Roman Stanchak 2004-02-23 18:45:38 UTC
The ebuild for gcc-3.3.3 refused to compile for me on Friday.  I'll try it again tonight.
Comment 5 Roman Stanchak 2004-02-25 14:55:22 UTC
gcc-3.3.3 compiled.
Same problem w/ compiler error.
Comment 6 Alexander Gabert (RETIRED) gentoo-dev 2004-03-01 07:54:00 UTC
can you try to explicitly add -fno-stack-protector to the build and leave out all -Ox optimizations?

thanks,

pappy
Comment 7 Roman Stanchak 2004-03-02 21:09:18 UTC
no -O optimizations: compilation success
-01 optimization: success
-02 : failure
-fno-stack-protector doesn't seem to affect the outcome.
Comment 8 Roman Stanchak 2004-03-02 22:43:52 UTC
after a random search through gcc flag space, the following

g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I. -I../include -I../.. -g -mcpu=i686 -march=i686 -fomit-frame-pointer -DNDEBUG -Wall 
-fno-rtti -fno-stack-protector -pipe -c cvfundam.cpp -MT cvfundam.lo -MD -MP -MF .deps/cvfundam.TPlo  -fPIC -DPIC -O1 -fno-math-errno -funsafe-math-optimizations -fcse-follow-jumps -frerun-cse-after-loop -fgcse -fexpensive-optimizations -o cvfundam.lo

is the minimum flag set I could figure that produced the error.  Interestingly, if I replace -O1 with the flags that "man gcc" tells me -O1 adds, compilation completes successfully.
Comment 9 Alexander Gabert (RETIRED) gentoo-dev 2004-09-23 19:11:17 UTC
This is not an ebuild and compiling applications with too aggressive optimizations is a known cause for problems.

Closing as CANTFIX.