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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |marxin at gcc dot 
gnu.org

--- Comment #10 from Martin Liška <marxin at gcc dot gnu.org> ---
Thanks. I was able to reproduce that. It's related to the usage of '#line XYZ'
directives which generate a situation where the function ends before it begins.
I was able to reduce that to something like:

$ cat x.c
void
foo()
{
#line 1
}

$ gcc --coverage x.c
during IPA pass: profile
x.c: In function ‘foo’:
x.c:1:1: internal compiler error: in coverage_begin_function, at coverage.c:662
    1 | void
      | ^
0xa3168b coverage_begin_function(unsigned int, unsigned int)
        /home/marxin/Programming/gcc/gcc/coverage.c:662
0xde935f branch_prob(bool)
        /home/marxin/Programming/gcc/gcc/profile.c:1328
0xf7bd60 tree_profiling
        /home/marxin/Programming/gcc/gcc/tree-profile.c:782
0xf7bd60 execute
        /home/marxin/Programming/gcc/gcc/tree-profile.c:888
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

We should not ICE, but rather a warning should be emitted.

Reply via email to