public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug gcov-profile/101487] New: [GCOV] Wrong coverage of "switch" inside "while" loop
@ 2021-07-17 13:04 njuwy at smail dot nju.edu.cn
  2022-03-28 15:32 ` [Bug gcov-profile/101487] " njuwy at smail dot nju.edu.cn
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: njuwy at smail dot nju.edu.cn @ 2021-07-17 13:04 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101487
           Summary: [GCOV] Wrong coverage of "switch" inside "while" loop
           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
void foo(int x, int y) {
  while (x > 0)
    switch (({
      if (y)
        break;
      y;
    })) {
    case 2:
      x = 0;
    }
}

int main() {
  foo(1, 1);
  return 0;
}

$ gcc -O0 --coverage test.c;./a.out;gcov test;cat test.c.gcov
File 'test.c'
Lines executed:66.67% of 12
Creating 'test.c.gcov'

        -:    0:Source:test.c
        -:    0:Graph:test.gcno
        -:    0:Data:test.gcda
        -:    0:Runs:1
        1:    1:void foo(int x, int y) {
        1:    2:  while (x > 0)
    #####:    3:    switch (({
        1:    4:      if (y)
        1:    5:        break;
    #####:    6:      y;
        -:    7:    })) {
    #####:    8:    case 2:
    #####:    9:      x = 0;
        -:   10:    }
        1:   11:}
        -:   12:
        1:   13:int main() {
        1:   14:  foo(1, 1);
        1:   15:  return 0;
        -:   16:}


Line 3 was wrongly marked as unexecuted

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

* [Bug gcov-profile/101487] [GCOV] Wrong coverage of "switch" inside "while" loop
  2021-07-17 13:04 [Bug gcov-profile/101487] New: [GCOV] Wrong coverage of "switch" inside "while" loop njuwy at smail dot nju.edu.cn
@ 2022-03-28 15:32 ` njuwy at smail dot nju.edu.cn
  2022-06-14 12:42 ` njuwy at smail dot nju.edu.cn
  2022-06-14 12:44 ` njuwy at smail dot nju.edu.cn
  2 siblings, 0 replies; 4+ messages in thread
From: njuwy at smail dot nju.edu.cn @ 2022-03-28 15:32 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

* [Bug gcov-profile/101487] [GCOV] Wrong coverage of "switch" inside "while" loop
  2021-07-17 13:04 [Bug gcov-profile/101487] New: [GCOV] Wrong coverage of "switch" inside "while" loop njuwy at smail dot nju.edu.cn
  2022-03-28 15:32 ` [Bug gcov-profile/101487] " njuwy at smail dot nju.edu.cn
@ 2022-06-14 12:42 ` njuwy at smail dot nju.edu.cn
  2022-06-14 12:44 ` njuwy at smail dot nju.edu.cn
  2 siblings, 0 replies; 4+ messages in thread
From: njuwy at smail dot nju.edu.cn @ 2022-06-14 12:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|INVALID                     |FIXED

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

* [Bug gcov-profile/101487] [GCOV] Wrong coverage of "switch" inside "while" loop
  2021-07-17 13:04 [Bug gcov-profile/101487] New: [GCOV] Wrong coverage of "switch" inside "while" loop njuwy at smail dot nju.edu.cn
  2022-03-28 15:32 ` [Bug gcov-profile/101487] " njuwy at smail dot nju.edu.cn
  2022-06-14 12:42 ` njuwy at smail dot nju.edu.cn
@ 2022-06-14 12:44 ` njuwy at smail dot nju.edu.cn
  2 siblings, 0 replies; 4+ messages in thread
From: njuwy at smail dot nju.edu.cn @ 2022-06-14 12:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Yang Wang <njuwy at smail dot nju.edu.cn> ---
it still exists in the latest version

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

end of thread, other threads:[~2022-06-14 12:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-17 13:04 [Bug gcov-profile/101487] New: [GCOV] Wrong coverage of "switch" inside "while" loop njuwy at smail dot nju.edu.cn
2022-03-28 15:32 ` [Bug gcov-profile/101487] " njuwy at smail dot nju.edu.cn
2022-06-14 12:42 ` njuwy at smail dot nju.edu.cn
2022-06-14 12:44 ` 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).