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

            Bug ID: 106090
           Summary: [GCOV] Wrong coverage for loop statements
           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: ---

-:    0:Source:test.c
        -:    0:Graph:test.gcno
        -:    0:Data:test.gcda
        -:    0:Runs:1
        -:    1:volatile int cnt = 0;
        -:    2:
        -:    3:__attribute__((noinline, noclone)) static int
        5:    4:last (void)
        -:    5:{
        5:    6:  return ++cnt % 5 == 0;
        -:    7:}
        -:    8:
        -:    9:__attribute__((noinline, noclone)) static void
        6:   10:do_it (void)
        -:   11:{
        6:   12:  asm volatile ("" : : "r" (&cnt) : "memory");
        6:   13:}
        -:   14:
        1:   15:static void f1 (void)
        -:   16:{
        1:   17:  do_it();
        4:   18:  for (;; do_it())
        -:   19:    {
        5:   20:      if (last ())
        1:   21:        break;
        -:   22:    }
        1:   23:  do_it ();
        1:   24:}
        -:   25:
        -:   26:int
        1:   27:main ()
        -:   28:{
        1:   29:  f1 ();
        -:   30:}
Should the coverage of line 18 be 5?

Reply via email to