public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug gcov-profile/100938] New: [GCOV] Coverage changes when a statement is divided in multiple lines
@ 2021-06-07  3:07 njuwy at smail dot nju.edu.cn
  2021-06-10 14:51 ` [Bug gcov-profile/100938] " marxin at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: njuwy at smail dot nju.edu.cn @ 2021-06-07  3:07 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100938
           Summary: [GCOV] Coverage changes when a statement is divided in
                    multiple lines
           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
int fn5(int x){
return -x;
}
int fn2(int x,int y){
return x+3-y;
}
int fn6(int x,int y){
return x+y;
}
int fn7(int x){
return 2*x;
}

int main()
{
int t1,t2,t3,t4,t5=1;
int b=1,y;
 y = fn5(b && fn2(t1=t2,fn6(fn7(t3) < t4,t5)));
 y = fn5(b && fn2(t1=t2,
        fn6(fn7(t3) < t4,t5)));
}

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

        -:    0:Source:test.c
        -:    0:Graph:test.gcno
        -:    0:Data:test.gcda
        -:    0:Runs:1
        2:    1:int fn5(int x){
        2:    2:return -x;
        -:    3:}
        2:    4:int fn2(int x,int y){
        2:    5:return x+3-y;
        -:    6:}
        2:    7:int fn6(int x,int y){
        2:    8:return x+y;
        -:    9:}
        2:   10:int fn7(int x){
        2:   11:return 2*x;
        -:   12:}
        -:   13:
        1:   14:int main()
        -:   15:{
        1:   16:int t1,t2,t3,t4,t5=1;
        1:   17:int b=1,y;
       1*:   18: y = fn5(b && fn2(t1=t2,fn6(fn7(t3) < t4,t5)));
       2*:   19: y = fn5(b && fn2(t1=t2,
        1:   20:        fn6(fn7(t3) < t4,t5)));
        -:   21:}

Line 18 and 19 should be executed the same number of times

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

* [Bug gcov-profile/100938] [GCOV] Coverage changes when a statement is divided in multiple lines
  2021-06-07  3:07 [Bug gcov-profile/100938] New: [GCOV] Coverage changes when a statement is divided in multiple lines njuwy at smail dot nju.edu.cn
@ 2021-06-10 14:51 ` marxin at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-06-10 14:51 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-06-10

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed.

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

end of thread, other threads:[~2021-06-10 14:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-07  3:07 [Bug gcov-profile/100938] New: [GCOV] Coverage changes when a statement is divided in multiple lines njuwy at smail dot nju.edu.cn
2021-06-10 14:51 ` [Bug gcov-profile/100938] " marxin at gcc dot gnu.org

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).