https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99442

            Bug ID: 99442
           Summary: [GCOV] No coverage with "Segmentation fault (core
                    dumped)"
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: gcov-profile
          Assignee: unassigned at gcc dot gnu.org
          Reporter: njuwy at smail dot nju.edu.cn
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/10.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure -enable-checking=release -enable-languages=c,c++
-disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (GCC) 

$ cat test.c
#include <stdio.h>
char fixed_regs[0x00080000];

int main() { 
printf("PASSED\n");
return fixed_regs[0x000ff000]; 
}

$ gcc -O0 --coverage test.c;./a.out;gcov test;cat test.c.gcov
PASSED
Segmentation fault (core dumped)
test.gcda:cannot open data file, assuming not executed
File 'test.c'
Lines executed:0.00% of 3
Creating 'test.c.gcov'

        -:    0:Source:test.c
        -:    0:Graph:test.gcno
        -:    0:Data:-
        -:    0:Runs:0
        -:    1:#include <stdio.h>
        -:    2:char fixed_regs[0x00080000];
        -:    3:
    #####:    4:int main() { 
    #####:    5:printf("PASSED\n");
    #####:    6:return fixed_regs[0x000ff000]; 
        -:    7:}


Obviously, main function has been executed. However, no coverage information
generated.

Reply via email to