Summary: | corrupted profile info after optimized compilation and --fprofile-use | ||
---|---|---|---|
Product: | gcc | Reporter: | joc |
Component: | gcov-profile | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED INVALID | ||
Severity: | normal | CC: | gcc-bugs |
Priority: | P2 | ||
Version: | 3.4.1 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | ||
Attachments: | c/h files and gcda file to reproduce -fprofile-use bug |
Description
joc
2004-10-25 21:49:46 UTC
How did you compile the one which you are profiling? Created attachment 7409 [details]
c/h files and gcda file to reproduce -fprofile-use bug
The file has been compiled with gcc -DHAVE_CONFIG_H -I. -O3 -DDBUG_OFF -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -mtune=athlon-mp -march=athlon-mp -mfpmath=sse -mmmx -msse -m3dnow -O3 -fomit-frame-pointer -fmove-all-movables -freduce-all-givs -frename-registers -fprofile-generate -fbranch-target-load-optimize2 -MT ctype-latin1.o -MD -MP -MF ".deps/ctype-latin1.Tpo" -c -o ctype-latin1.o ctype-latin1.c command line Note also that occurs when trying to compile MySQL with -fprofile-use flag, and several other files are affected by the problem (but now all the files). For example, an other error during compilation : [root@forumsql] /usr/local/mysql-4.1/innobase/page> gcc -DHAVE_CONFIG_H -I. -I. -I.. -I./../include -I./../../include -I../../include -DDBUG_OFF -O3 -DDBUG_OFF -mtune=athlon-mp -march=athlon-mp -fprofile-use -DDEBUG_OFF -DUNIV_LINUX -DUNIV_INTEL_X86 -MT page0page.o -MD -MP -MF ".deps/page0page.Tpo" -c -o page0page.o page0page.c; page0page.c: In function `page_rec_get_n_recs_before': page0page.c:1112: error: corrupted profile info: number of executions for edge 1-2 thought to be -1 page0page.c:1112: error: corrupted profile info: number of executions for edge 1-11 thought to be 1497932 page0page.c:1112: error: corrupted profile info: number of iterations for basic block 2 thought to be -1 page0page.c:1112: error: corrupted profile info: number of executions for edge 16-17 thought to be -3 page0page.c:1112: error: corrupted profile info: number of executions for edge 16-26 thought to be 107993545 When removing the -mtune / -march flags : [root@forumsql] /usr/local/mysql-4.1/innobase/page> gcc -DHAVE_CONFIG_H -I. -I. -I.. -I./../include -I./../../include -I../../include -DDBUG_OFF -O3 -DDBUG_OFF -fprofile-use -DDEBUG_OFF -DUNIV_LINUX -DUNIV_INTEL_X86 -MT page0page.o -MD -MP -MF ".deps/page0page.Tpo" -c -o page0page.o page0page.c; page0page.c: In function `page_delete_rec_list_end': page0page.c:700: error: coverage mismatch for function 'page_delete_rec_list_end' while reading counter 'arcs'. page0page.c:700: error: number of counters is 250 instead of 251 When removing the -O3 flag, a lot of "warning: no coverage for function 'function_name' found", but no more compilation errors. Any news about this issue ? Thanks ! Jocelyn We need a self-contained test case. You have not provided that, so now we cannot reproduce the bug. Please read http://gcc.gnu.org/bugs.html. In this case, I get lots of missing symbols errors at link time: /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.4/../../../../lib/crt1.o(.text+0x18): In function `_start': ../sysdeps/i386/elf/start.S:115: undefined reference to `main' /tmp/ccuZB30b.o(.data+0xf28): undefined reference to `my_mbcharlen_8bit' /tmp/ccuZB30b.o(.data+0xf2c): undefined reference to `my_numchars_8bit' /tmp/ccuZB30b.o(.data+0xf30): undefined reference to `my_charpos_8bit' /tmp/ccuZB30b.o(.data+0xf34): undefined reference to `my_well_formed_len_8bit' /tmp/ccuZB30b.o(.data+0xf38): undefined reference to `my_lengthsp_8bit' /tmp/ccuZB30b.o(.data+0xf3c): undefined reference to `my_numcells_8bit' (etc.) So I can't reproduce your problem. No feedback in 3 month (T-10 days). |