/var/tmp/portage/gcc-4.1.0_beta20050716/work/gcc-4.1-20050716/gcc/tree-ssa-loop-niter.c:994: error: corrupted profile info: number of executions for edge 82-89 thought to be -24 /var/tmp/portage/gcc-4.1.0_beta20050716/work/gcc-4.1-20050716/gcc/tree-ssa-loop-niter.c:994: error: corrupted profile info: number of executions for edge 82-83 thought to be 24 /var/tmp/portage/gcc-4.1.0_beta20050716/work/gcc-4.1-20050716/gcc/tree-ssa-loop-niter.c:994: error: corrupted profile info: number of executions for edge 90-93 thought to be -24 /var/tmp/portage/gcc-4.1.0_beta20050716/work/gcc-4.1-20050716/gcc/tree-ssa-loop-niter.c:994: error: corrupted profile info: number of executions for edge 90-91 thought to be 24 /var/tmp/portage/gcc-4.1.0_beta20050716/work/gcc-4.1-20050716/gcc/tree-ssa-loop-niter.c:994: error: corrupted profile info: number of executions for edge 92-231 thought to be -48 /var/tmp/portage/gcc-4.1.0_beta20050716/work/gcc-4.1-20050716/gcc/tree-ssa-loop-niter.c:994: error: corrupted profile info: number of executions for edge 92-93 thought to be 72 /var/tmp/portage/gcc-4.1.0_beta20050716/work/gcc-4.1-20050716/gcc/tree-ssa-loop-niter.c:994: error: corrupted profile info: number of executions for edge 119-123 thought to be -24 /var/tmp/portage/gcc-4.1.0_beta20050716/work/gcc-4.1-20050716/gcc/tree-ssa-loop-niter.c:994: error: corrupted profile info: number of executions for edge 119-120 thought to be 24 /var/tmp/portage/gcc-4.1.0_beta20050716/work/gcc-4.1-20050716/gcc/tree-ssa-loop-niter.c:994: error: corrupted profile info: number of executions for edge 122-231 thought to be -24 /var/tmp/portage/gcc-4.1.0_beta20050716/work/gcc-4.1-20050716/gcc/tree-ssa-loop-niter.c:994: error: corrupted profile info: number of executions for edge 122-123 thought to be 24 /var/tmp/portage/gcc-4.1.0_beta20050716/work/gcc-4.1-20050716/gcc/tree-ssa-loop-niter.c:994: error: corrupted profile info: number of executions for edge 124-243 thought to be -24 /var/tmp/portage/gcc-4.1.0_beta20050716/work/gcc-4.1-20050716/gcc/tree-ssa-loop-niter.c:994: error: corrupted profile info: number of executions for edge 124-125 thought to be 24 /var/tmp/portage/gcc-4.1.0_beta20050716/work/gcc-4.1-20050716/gcc/tree-ssa-loop-niter.c:994: error: corrupted profile info: number of executions for edge 151-153 thought to be -24 /var/tmp/portage/gcc-4.1.0_beta20050716/work/gcc-4.1-20050716/gcc/tree-ssa-loop-niter.c:994: error: corrupted profile info: number of executions for edge 151-152 thought to be 24 /var/tmp/portage/gcc-4.1.0_beta20050716/work/gcc-4.1-20050716/gcc/tree-ssa-loop-niter.c:994: error: corrupted profile info: number of executions for edge 214-218 thought to be -24 /var/tmp/portage/gcc-4.1.0_beta20050716/work/gcc-4.1-20050716/gcc/tree-ssa-loop-niter.c:994: error: corrupted profile info: number of executions for edge 214-215 thought to be 24 /var/tmp/portage/gcc-4.1.0_beta20050716/work/gcc-4.1-20050716/gcc/tree-ssa-loop-niter.c:994: error: corrupted profile info: number of iterations for basic block 218 thought to be -24 make[2]: *** [tree-ssa-loop-niter.o] Error 1 make[2]: Leaving directory `/var/tmp/portage/gcc-4.1.0_beta20050716/work/build/gcc' make[1]: *** [stagefeedback_build] Error 2 make[1]: Leaving directory `/var/tmp/portage/gcc-4.1.0_beta20050716/work/build/gcc' make: *** [profiledbootstrap] Error 2 !!! ERROR: sys-devel/gcc-4.1.0_beta20050716 failed. !!! Function gcc_do_make, Line 1214, Exitcode 2 !!! emake failed with profiledbootstrap !!! If you need support, post the topmost build error, NOT this status message. Portage 2.0.51.22-r2 (default-linux/x86/2005.0, gcc-3.4.4, glibc-2.3.5-r0, 2.6.12-gentoo-r6 i686) ================================================================= System uname: 2.6.12-gentoo-r6 i686 Intel(R) Pentium(R) 4 CPU 2.53GHz Gentoo Base System version 1.4.16 dev-lang/python: 2.3.4-r1, 2.4.1-r1 sys-apps/sandbox: 1.2.11 sys-devel/autoconf: 2.13, 2.59-r7 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6 sys-devel/binutils: 2.16.1 sys-devel/libtool: 1.5.18-r1 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=pentium4 -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -march=pentium4 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig ccache distlocks sandbox sfperms strict userpriv usersandbox" GENTOO_MIRRORS="ftp://216.165.129.134/gentoo http://gentoo.ccccom.com http://194.117.143.70 http://194.117.143.71" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.us.gentoo.org/gentoo-portage" USE="x86 X aalib acpi aim alsa apache2 avi bash-completion bitmap-fonts browserplugin cdr crypt cups dba divx4linux dvd encode esd flac fluxbox font-server ftp gd gd-external gif gtk gtk2 icq idea imap imlib java jikes jpeg mad mmx mmx2 mozilla mp3 mpeg ncurses nocd nptl nptlonly offensive ogg oggvorbis opengl pam pcmcia php pic png posix python samba sdl spell sse sse2 ssl tcltk tcpd tiff truetype truetype-fonts type1-fonts udev unicode usb vim vorbis xmms xprint xv xvid userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY as you can see, i am using gcc-3.4.4 to try to compile 4.1beta. when i get the chance, i will try to compile using 3.3.6 to see if the problem is there too
the same problem happens when trying to compile 4.1 with gcc 3.3.6 i forgot to paste `emerge -pv` the first time :-) smithy@elana ~ $ emerge -pv gcc These are the packages that I would merge, in order: Calculating dependencies ...done! [ebuild NS ] sys-devel/gcc-4.1.0_beta20050716 (-altivec) -bootstrap -build -fortran -gcj +gtk -hardened -ip28 (-multilib) -multislot (-n32) (-n64) -nls -nocxx -objc -static 0 kB [ebuild N ] sys-libs/libstdc++-v3-3.3.4 (-multilib) -nls +nptl 22,784 kB Total size of downloads: 22,784 kB
Try CFLAGS="-O1 -march=pentium4 -pipe" gcc-4.1 just entered stage 3 a week or so ago, so it is still very beta.
(In reply to comment #2) > Try CFLAGS="-O1 -march=pentium4 -pipe" still failed :-/
Check whether the -O1 is actually being honoured - I suspect that it isn't. You might be able to get it to work with just -O rather than -O1 (they are equivalent as far as gcc is concerned, anyway.) (The toolchain.eclass rewrites "-O?" to "-O2" - unfortunately, this turns -O1 into -O2.) Phil
Ok, semi-ignore the last comment from me (it's still true about the override of -O1, though). I can't get Gentoo patched 4.1.0_beta20050716 to build even with -O - I can build the "raw" gcc distribution with -O1 and with -O2, so it looks Gentoo specific. I didn't have this problem with the 20050709 beta (though other people did)...
20050723 fails too... perhaps i am doing something wrong? /var/tmp/portage/gcc-4.1.0_beta20050723/work/gcc-4.1-20050723/gcc/expmed.c: In function 'expand_divmod': /var/tmp/portage/gcc-4.1.0_beta20050723/work/gcc-4.1-20050723/gcc/expmed.c:4819: error: corrupted profile info: number of executions for edge 582-650 thought to be -4 /var/tmp/portage/gcc-4.1.0_beta20050723/work/gcc-4.1-20050723/gcc/expmed.c:4819: error: corrupted profile info: number of executions for edge 582-583 thought to be 6 make[2]: *** [expmed.o] Error 1 make[2]: Leaving directory `/var/tmp/portage/gcc-4.1.0_beta20050723/work/build/gcc' make[1]: *** [stagefeedback_build] Error 2 make[1]: Leaving directory `/var/tmp/portage/gcc-4.1.0_beta20050723/work/build/gcc' make: *** [profiledbootstrap] Error 2 !!! ERROR: sys-devel/gcc-4.1.0_beta20050723 failed. !!! Function gcc_do_make, Line 1214, Exitcode 2 !!! emake failed with profiledbootstrap !!! If you need support, post the topmost build error, NOT this status message.
I can confirm that gcc-4.1-20050723 vanilla (no Gentoo patches) compiles fine with CFLAGS="-O2 -march=pentium4 -pipe" (CXXFLAGS the same). It fails in tree-ssa-loop-niter.c as before when emerge'ing the current ebuild with Gentoo patches with reduced optimisation of "-O". Time for me to try and find the guilty patch, I suppose... Phil
Phil, did you do a bootstrap or profiledbootstrap vanilla build? Given the error message I suspect profiledbootstrap might be the problem with the gentoo emerge. I have no idea how to change the ebuild to call the bootstrap target, however, so I couldn't check.
Yep, I did a plain old "bootstrap". I'll try again with a profiledbootstrap and see whether that gets through...
Yep, I can now confirm that the vanilla gcc dist fails with the same error as the Gentoo ebuild when built with profiledbootstrap. The toolchain.eclass deliberately uses profiledbootstrap for gcc versions > 3.3. No idea why. You can override the "guessed" target by doing: GCC_MAKE_TARGET=bootstrap emerge --oneshot gcc It certainly gets the emerge to use the right target - just trying to see if the compilation finishes now...
Check upstream to see if anyone filed a bug. Its going to probably be related to problems with optimizations. Hopefully it'll be fixed in the upcoming snapshots, but I'm leaving it the way it is for now.
I found two upstream PRs related to profiling: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22314 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22471 The second seems to cover the problem we are having. Yesterday there was a post by Daniel Berlin: >>... >> Honza said he knew what was up and would fix it >>... So I guess it would be worth waiting a bit and see how that progresses. Mark, would it be an option to have a USE flag that switches profiling on/off? I read elsewhere on gcc@gnu.org that profiling produces *slower* code in some cases right now for mainline. So the USE flag might be worth having even when the profiledbootstrap failure is fixed. Best, Peter
gcc 4.1.0-beta20050730 seems to compiles cleanly with profiledbootstrap...