Tools versions: # uname -a Linux Beast 2.6.11-gentoo-r11 #2 Wed Jun 15 09:13:40 CEST 2005 x86_64 x86_64 x86_64 GNU/Linux # gcc -v Reading specs from /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/specs Configured with: ../gcc-3.4.4/configure --libexecdir=/usr/lib --enable-shared --enable-languages=c,c++,f77,objc --enable-clocale=gnu --enable-threads=posix --enable-__cxa_atexit Thread model: posix gcc version 3.4.4 # as --version GNU assembler 2.16.1 Copyright 2005 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License. This program has absolutely no warranty. This assembler was configured for a target of `x86_64-pc-linux-gnu'. # /lib/libc.so.6 GNU C Library stable release version 2.3.5, by Roland McGrath et al. Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Compiled by GNU CC version 3.4.4. Compiled on a Linux 2.6.11 system on 2005-07-05. Available extensions: GNU libio by Per Bothner crypt add-on version 2.1 by Michael Glad and others Native POSIX Threads Library by Ulrich Drepper et al BIND-8.2.3-T5B NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk Thread-local storage support included. For bug reporting instructions, please see: <http://www.gnu.org/software/libc/bugs.html>. Reproducible: Always Steps to reproduce: 1. Untar release distribution of GCC 3.4.4 2. Make gcc-build directory 3. Configure GCC for building; # CFLAGS="-pipe -O2 -march=athlon64 -fweb -ftracer -frename-registers -fprofile-generate" LDFLAGS="${LDFLAGS} -fprofile-generate" ../gcc-3.4.4/configure --libexecdir=/usr/lib --enable-shared --enable-languages=c,c++,objc,f77 --enable-clocale=gnu --enable-threads=posix --enable-__cxa_atexit 4. Build GCC; # make LDFLAGS="${LDFLAGS} -fprofile-generate" 5. Run testsuite on newly built GCC; # make -k check Result: The testsuite barks out on one of torture tests; Executing on host: /root/gcc-build/gcc/xgcc -B/root/gcc-build/gcc/ -O1 -w -c -o 20010404-1.o /root/gcc-3.4.4/gcc/testsuite/gcc.c-torture/compile/20010404-1.c (timeout = 300) profiling:/root/gcc-build/gcc/simplify-rtx.gcda:Overflow writing output is: profiling:/root/gcc-build/gcc/simplify-rtx.gcda:Overflow writing and continues barking onwards with; profiling:/root/gcc-build/gcc/simplify-rtx.gcda:Overflow writing output is: profiling:/root/gcc-build/gcc/simplify-rtx.gcda:Overflow writing on every test that follows for gcc suite. Expected result: The same as without -fprofile-generate. Notes: I have marked this critical since there is no way I can use coverage for second build; # gcov -f /root/gcc-build/gcc/simplify-rtx simplify-rtx.gcno:cannot open graph file Though the file is there and readable, IMHO the format is corrupted by libgcov itself because of the "Overflow writing" error. I have seen this error with -fprofile-generate in other packages also (Python 2.4.1), so this is not GCC coverage profile specific. Regards
Note there is a profiledbootstrap you can use to do this. Also note this might be PR 12786.
"profiledbootstrap" is not I was intending to do. "profiledbootstrap" although a splendid idea is unfinished thing, it only profiles c compiler no matter what languages are selected in the --enable-languages switch. And that it does on a small number of test samples (libgcc only). While PR 12786 is somewhat related, it doesn't relate directly to this. IMHO this is clearly overflow bug, because of the cumulation of the data (take note that it doesn't drop error message during whole compilation of the GCC compiler including all supporting libraries, and drops error message just later in the "make -k check" phase). Another note, I have just made i686-pc-linux-gnu compiler on the same machine in the chroot and repeated the steps described. It went without a glitch, and second phase with -fprofile-use has used the profile data collected and created working compiler (make -k check phase on the second phase generated compiler produced expected results). That said, this is clearly x86_64-pc-linux-gnu problem (maybe 32/64 bit counter overlook?). Regards
3.x isn't supported anymore.