https://bugs.llvm.org/show_bug.cgi?id=38180

            Bug ID: 38180
           Summary: For programs which fork, some lines are wrongly
                    considered as hit twice
           Product: compiler-rt
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: profile
          Assignee: unassignedb...@nondot.org
          Reporter: mcastelluc...@mozilla.com
                CC: llvm-bugs@lists.llvm.org

For example:
        -:    0:Source:main.c
        -:    0:Graph:main.gcno
        -:    0:Data:main.gcda
        -:    0:Runs:2
        -:    0:Programs:1
        -:    1:#include <unistd.h>
        -:    2:
function main called 2 returned 100% blocks executed 100%
        -:    3:int main(void) {
        2:    4:  int j = 22;
        -:    5:
        2:    6:  fork();
        -:    7:
        2:    8:  int i = 7;
        -:    9:
        2:   10:  return 0;
        -:   11:}

With GCC:
        -:    0:Source:main.c
        -:    0:Graph:main.gcno
        -:    0:Data:main.gcda
        -:    0:Runs:1
        -:    0:Programs:1
        -:    1:#include <unistd.h>
        -:    2:
        1:    3:int main(void) {
        1:    4:  int j = 22;
        -:    5:
        1:    6:  fork();
        -:    7:
        2:    8:  int i = 7;
        -:    9:
        2:   10:  return 0;
        -:   11:}

The difference is probably due to the fact that GCC injects a __gcov_flush call
before the actual fork (similarly for execl, execlp, ...).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to