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"
Created attachment 26113 [details] Preprocessed source
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).
And gcc-3.3.3?
The ebuild for gcc-3.3.3 refused to compile for me on Friday. I'll try it again tonight.
gcc-3.3.3 compiled. Same problem w/ compiler error.
can you try to explicitly add -fno-stack-protector to the build and leave out all -Ox optimizations? thanks, pappy
no -O optimizations: compilation success -01 optimization: success -02 : failure -fno-stack-protector doesn't seem to affect the outcome.
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.
This is not an ebuild and compiling applications with too aggressive optimizations is a known cause for problems. Closing as CANTFIX.