public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug gcov-profile/101623] New: [GCOV] Wrong coverage of callee function
@ 2021-07-26 11:59 njuwy at smail dot nju.edu.cn
  2021-08-13 10:36 ` [Bug gcov-profile/101623] " njuwy at smail dot nju.edu.cn
  0 siblings, 1 reply; 2+ messages in thread
From: njuwy at smail dot nju.edu.cn @ 2021-07-26 11:59 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101623
           Summary: [GCOV] Wrong coverage of callee function
           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<stdlib.h>
char a[] = "12345";
char b[] = "12345";

void loop(char *pz, char *pzDta) {
  for (;;) {
    switch (*(pz++) = *(pzDta++)) {
    case 0:
      goto loopDone2;

    case '"':
    case '\\':
      pz[-1] = '\\';
      *(pz++) = pzDta[-1];
    }
  }
loopDone2:;

  if (a - pz != b - pzDta)
    abort();
}

int main() {
  loop(a, b);
  exit(0);
}

$ gcc -O0 --coverage test.c;./a.out;gcov test;cat test.c.gcov
libgcov profiling error:/home/wangyang/coverage/test/test.gcda:overwriting an
existing profile data with a different timestamp
File 'test.c'
Lines executed:71.43% of 14
Creating 'test.c.gcov'

        -:    0:Source:test.c
        -:    0:Graph:test.gcno
        -:    0:Data:test.gcda
        -:    0:Runs:1
        -:    1:#include<stdlib.h>
        -:    2:char a[] = "12345";
        -:    3:char b[] = "12345";
        -:    4:
        6:    5:void loop(char *pz, char *pzDta) {
        -:    6:  for (;;) {
        6:    7:    switch (*(pz++) = *(pzDta++)) {
        1:    8:    case 0:
        1:    9:      goto loopDone2;
        -:   10:
    #####:   11:    case '"':
        -:   12:    case '\\':
    #####:   13:      pz[-1] = '\\';
    #####:   14:      *(pz++) = pzDta[-1];
        -:   15:    }
        -:   16:  }
        1:   17:loopDone2:;
        -:   18:
        1:   19:  if (a - pz != b - pzDta)
    #####:   20:    abort();
        1:   21:}
        -:   22:
        1:   23:int main() {
        1:   24:  loop(a, b);
        1:   25:  exit(0);
        -:   26:}

Line 5 was executed only once.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug gcov-profile/101623] [GCOV] Wrong coverage of callee function
  2021-07-26 11:59 [Bug gcov-profile/101623] New: [GCOV] Wrong coverage of callee function njuwy at smail dot nju.edu.cn
@ 2021-08-13 10:36 ` njuwy at smail dot nju.edu.cn
  0 siblings, 0 replies; 2+ messages in thread
From: njuwy at smail dot nju.edu.cn @ 2021-08-13 10:36 UTC (permalink / raw)
  To: gcc-bugs

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

Yang Wang <njuwy at smail dot nju.edu.cn> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #1 from Yang Wang <njuwy at smail dot nju.edu.cn> ---
dup

*** This bug has been marked as a duplicate of bug 101192 ***

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-13 10:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-26 11:59 [Bug gcov-profile/101623] New: [GCOV] Wrong coverage of callee function njuwy at smail dot nju.edu.cn
2021-08-13 10:36 ` [Bug gcov-profile/101623] " njuwy at smail dot nju.edu.cn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).