I got some "coverage mismatch for function" messages during the -fprofile-use stage.
input/proc.c: In function 'Proc_2': input/proc.c:370:1: error: coverage mismatch for function 'Proc_2' while reading counter 'arcs' input/proc.c:370:1: note: checksum is 423e382 instead of 90c94998 input/proc.c: In function 'Proc_3': input/proc.c:370:1: error: coverage mismatch for function 'Proc_3' while reading counter 'arcs' input/proc.c:370:1: note: checksum is dc2432cd instead of d4d17dae input/proc.c: In function 'Proc_1': input/proc.c:370:1: error: coverage mismatch for function 'Proc_1' while reading counter 'arcs' input/proc.c:370:1: note: checksum is 85cc36f8 instead of 3e60643f input/proc.c: In function 'Proc_4': input/proc.c:370:1: error: coverage mismatch for function 'Proc_4' while reading counter 'arcs' input/proc.c:370:1: note: checksum is 96ab6db0 instead of 7edb2a20 input/proc.c: In function 'Proc_5': input/proc.c:370:1: error: coverage mismatch for function 'Proc_5' while reading counter 'arcs' input/proc.c:370:1: note: checksum is 1e3fe0b3 instead of 4d17a460 input/proc.c: In function 'main': input/proc.c:370:1: error: coverage mismatch for function 'main' while reading c ounter 'arcs' Source tree is something like: . |-- A | |-- foo.h | `-- proc.c |-- B | |-- bar.h | `-- proc.c `-- main.c Generation stage: gcc -fprofile-gen main.c A/proc.c B/proc.c -o main.exe I run main.exe. Feedback stage: gcc -fprofile-use main.c A/proc.c B/proc.c -o main.exe Then I get all these error messages. The problem is that the source tree contain two files with the same name (proc.c) and the instrumented executable generates the gcda files in the working directory, not in the directories containing the source files. The instrumented executable generates proc.gcda (from proc.c in A) and overwrites this one by proc.gcda (from proc.c in B). Or the opposite, I don't know. I can't find a command line switch to control that. -- Summary: gcda file names collision when profiling Product: gcc Version: 4.5.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: driver AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: bayerntoni at hotmail dot de GCC host triplet: i386-pc-mingw32 GCC target triplet: i386-pc-mingw32 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45582