public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug gcov-profile/96919] New: [GCOV] uncovered line of stack allocation while using virutal destructor
@ 2020-09-03 13:18 youngseok.roh.de at gmail dot com
  2020-09-21 11:00 ` [Bug gcov-profile/96919] " marxin at gcc dot gnu.org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: youngseok.roh.de at gmail dot com @ 2020-09-03 13:18 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96919
           Summary: [GCOV] uncovered line of stack allocation while using
                    virutal destructor
           Product: gcc
           Version: 8.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: gcov-profile
          Assignee: unassigned at gcc dot gnu.org
          Reporter: youngseok.roh.de at gmail dot com
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

I have different result since GCC8. It looks like connecting to the virtual
destructor.

<~ GCC 7.4.0>
$ cat main.cpp.gcov 
        -:    0:Source:main.cpp
        -:    0:Graph:main.gcno
        -:    0:Data:main.gcda
        -:    0:Runs:1
        -:    0:Programs:1
        -:    1:#include "hello.h"
        -:    2:
        1:    3:int main(int argc, char* argv[]) {
        2:    4:  Hello hello;
        1:    5:  hello.foo();
        1:    6:  return 0;
        -:    7:}
        -:    8:
<GCC 8.2.0 ~>
$ cat main.cpp.gcov 
        -:    0:Source:main.cpp
        -:    0:Graph:main.gcno
        -:    0:Data:main.gcda
        -:    0:Runs:1
        -:    0:Programs:1
        -:    1:#include "hello.h"
        -:    2:
        1:    3:int main(int argc, char* argv[]) {
    #####:    4:  Hello hello;
        1:    5:  hello.foo();
        1:    6:  return 0;
        -:    7:}
        -:    8:

Example code is here, and commands as well.
$ cat hello.h
class Base {
public:
  Base() = default;
  virtual ~Base() = default;
  virtual void foo() = 0;
};
class Hello : public Base {
public:
  Hello() = default;
  ~Hello() = default;
  void foo() override;
};

$ cat hello.cpp 
#include "hello.h"
#include <iostream>

using namespace std;

void Hello::foo() {
  cout << "hello" << endl;
}

$ cat main.cpp
#include "hello.h"

int main(int argc, char* argv[]) {
  Hello hello;
  hello.foo();
  return 0;
}

g++ -g -c --coverage -O0 -std=c++11 hello.cpp
g++ -g -c --coverage -O0 -std=c++11 main.cpp
g++ -o test hello.o main.o --coverage -O0

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

end of thread, other threads:[~2023-04-03  9:04 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-03 13:18 [Bug gcov-profile/96919] New: [GCOV] uncovered line of stack allocation while using virutal destructor youngseok.roh.de at gmail dot com
2020-09-21 11:00 ` [Bug gcov-profile/96919] " marxin at gcc dot gnu.org
2020-09-21 11:05 ` marxin at gcc dot gnu.org
2020-09-28 13:19 ` filip.pudak at gmail dot com
2020-09-29  7:48 ` marxin at gcc dot gnu.org
2020-10-02 11:29 ` marxin at gcc dot gnu.org
2020-10-26  7:13 ` libin.dang at gmail dot com
2020-10-26 14:55 ` marxin at gcc dot gnu.org
2020-11-17 15:06 ` bhavana.kilambi at blackfigtech dot com
2020-12-02 17:08 ` bhavana.kilambi at blackfigtech dot com
2020-12-02 17:10 ` bhavana.kilambi at blackfigtech dot com
2020-12-03 10:01 ` marxin at gcc dot gnu.org
2020-12-29  9:17 ` bhavana.kilambi at blackfigtech dot com
2021-01-06 11:55 ` marxin at gcc dot gnu.org
2021-01-06 13:55 ` bhavana.kilambi at blackfigtech dot com
2021-01-07 13:27 ` marxin at gcc dot gnu.org
2022-04-21  9:29 ` marxin at gcc dot gnu.org
2023-04-03  9:04 ` 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).