[Bug gcov-profile/67937] gcov gives wrong results when negative counts are involved
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67937 Jan Hubicka changed: What|Removed |Added Status|UNCONFIRMED |ASSIGNED Last reconfirmed||2016-05-20 CC||hubicka at gcc dot gnu.org Assignee|unassigned at gcc dot gnu.org |hubicka at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #5 from Jan Hubicka --- I will take a look.
[Bug gcov-profile/67937] gcov gives wrong results when negative counts are involved
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67937 --- Comment #6 from Jan Hubicka --- We can have negative counters on fake edges in case the code uses abnormal edges that we can't instrument correctly. setjmp/longjmp is one of examples. If you profile kernel, you will have inconsistencies in profile because of race conditions.
[Bug gcov-profile/67937] gcov gives wrong results when negative counts are involved
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67937 --- Comment #1 from Joshua Cranmer --- Created attachment 36485 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36485&action=edit test-case.gcda (It's a 4.7 test case, but the file format can still be read with trunk gcov the last I checked. Since the originating issue comes from "compile Firefox", I haven't tried preparing .gcda/.gcno files from newer gcc).
[Bug gcov-profile/67937] gcov gives wrong results when negative counts are involved
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67937 --- Comment #2 from Joshua Cranmer --- Created attachment 36486 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36486&action=edit test-case.gcno And the corresponding .gcno file. The testcase was minimized by bisecting the original .gcda/.gcno files by dropping functions and seeing where my attempt to write a new implementation that matched gcov's output failed. The attempt (I did several!) that failed this time was using Boost graph library's hawick_circuits detector, which matched the input incorrectly since this is double-counting loop edges if one of them is negative.
[Bug gcov-profile/67937] gcov gives wrong results when negative counts are involved
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67937 --- Comment #3 from Richard Biener --- Most interesting would be a C testcase that produces the CFG with the bogus counters ;)
[Bug gcov-profile/67937] gcov gives wrong results when negative counts are involved
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67937 --- Comment #4 from Joshua Cranmer --- (In reply to Richard Biener from comment #3) > Most interesting would be a C testcase that produces the CFG with the bogus > counters ;) Yeah, I know, but doing the minimization on a 5MLOC program takes time.