public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug gcov-profile/105500] New: [Gcov]wrong freqency for the while loop with struct in the expression
@ 2022-05-06  3:11 yangyibiao at nju dot edu.cn
  2022-05-06  6:11 ` [Bug gcov-profile/105500] " rguenth at gcc dot gnu.org
  2022-05-10 11:29 ` marxin at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: yangyibiao at nju dot edu.cn @ 2022-05-06  3:11 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105500
           Summary: [Gcov]wrong freqency for the while loop with struct in
                    the expression
           Product: gcc
           Version: 7.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: gcov-profile
          Assignee: unassigned at gcc dot gnu.org
          Reporter: yangyibiao at nju dot edu.cn
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

$ cat small.c
struct S { int f; } a;

struct S foo (int x, struct S y)
{
  int b = y.f;
  return a; 
}

void bar ()
{
  while (a.f)
    {
      struct S c = {0};
      foo (0, c);
    }
}

int main ()
{
  bar (); 
  return 0;
}

$ gcc -O0 --coverage small.c; ./a.out; gcov small.c; cat small.c.gcov
File 'small.c'
Lines executed:54.55% of 11
Creating 'small.c.gcov'

        -:    0:Source:small.c
        -:    0:Graph:small.gcno
        -:    0:Data:small.gcda
        -:    0:Runs:1
        -:    0:Programs:1
        -:    1:struct S { int f; } a;
        -:    2:
    #####:    3:struct S foo (int x, struct S y)
        -:    4:{
    #####:    5:  int b = y.f;
    #####:    6:  return a; 
        -:    7:}
        -:    8:
        1:    9:void bar ()
        -:   10:{
        2:   11:  while (a.f)
        -:   12:    {
    #####:   13:      struct S c = {0};
    #####:   14:      foo (0, c);
        -:   15:    }
        1:   16:}
        -:   17:
        1:   18:int main ()
        -:   19:{
        1:   20:  bar (); 
        1:   21:  return 0;
        -:   22:}

Line #11 is wrongly marked as executed twice which should be executed once.

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

* [Bug gcov-profile/105500] [Gcov]wrong freqency for the while loop with struct in the expression
  2022-05-06  3:11 [Bug gcov-profile/105500] New: [Gcov]wrong freqency for the while loop with struct in the expression yangyibiao at nju dot edu.cn
@ 2022-05-06  6:11 ` rguenth at gcc dot gnu.org
  2022-05-10 11:29 ` marxin at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-06  6:11 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |11.3.1, 7.5.0
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-05-06

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.

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

* [Bug gcov-profile/105500] [Gcov]wrong freqency for the while loop with struct in the expression
  2022-05-06  3:11 [Bug gcov-profile/105500] New: [Gcov]wrong freqency for the while loop with struct in the expression yangyibiao at nju dot edu.cn
  2022-05-06  6:11 ` [Bug gcov-profile/105500] " rguenth at gcc dot gnu.org
@ 2022-05-10 11:29 ` marxin at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-05-10 11:29 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed with r8-253-g6e49961ce47b8c55.

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

end of thread, other threads:[~2022-05-10 11:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-06  3:11 [Bug gcov-profile/105500] New: [Gcov]wrong freqency for the while loop with struct in the expression yangyibiao at nju dot edu.cn
2022-05-06  6:11 ` [Bug gcov-profile/105500] " rguenth at gcc dot gnu.org
2022-05-10 11:29 ` 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).