[Bug gcov-profile/97062] New: [gcov] Don't repeat display of inline functions in headers
i at maskray dot me
gcc-bugzilla@gcc.gnu.org
Wed Sep 16 00:26:44 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97062
Bug ID: 97062
Summary: [gcov] Don't repeat display of inline functions in
headers
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: gcov-profile
Assignee: unassigned at gcc dot gnu.org
Reporter: i at maskray dot me
CC: marxin at gcc dot gnu.org
Target Milestone: ---
This is a minor display issue.
>a.cc cat<<e
#include "a.h"
void foo();
int main() {
foo();
bar();
}
e
>b.cc cat<<e
#include "a.h"
void foo() {
bar();
}
e
>a.h cat<<e
inline void bar() {
;
}
e
rm -f *.gcda; g++-10 --coverage a.cc b.cc; ./a.out
If I specify multiple input on the command line:
% gcov-10 -t a. b.
-: 0:Source:a.cc
-: 1:#include "a.h"
-: 2:void foo();
1: 3:int main() {
1: 4: foo();
1: 5: bar();
1: 6:}
-: 0:Source:a.h
2*: 1:inline void bar() {
-: 2: ;
2*: 3:}
------------------
_Z3barv:
2: 1:inline void bar() {
-: 2: ;
2: 3:}
------------------
_Z3barv:
#####: 1:inline void bar() {
-: 2: ;
#####: 3:}
------------------
-: 0:Source:b.cc
-: 1:#include "a.h"
1: 2:void foo() {
1: 3: bar();
1: 4:}
bar is replicated. One may argue that bar should not be replicated because a.cc
and b.cc are calling the same copy. (If bar is `static inline`, duplication may
be justified, but gcov does not encode the linkage of functions)
More information about the Gcc-bugs
mailing list