public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/12076] gcov misreports coverage of return statement [NVR]
[not found] <bug-12076-6823@http.gcc.gnu.org/bugzilla/>
@ 2005-10-27 1:41 ` reddy at pixar dot com
2006-01-21 22:33 ` jbuck at welsh-buck dot org
` (4 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: reddy at pixar dot com @ 2005-10-27 1:41 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from reddy at pixar dot com 2005-10-27 01:41 -------
Having code coverage emit a "-" instead of "#####" in this case sounds
appropriate and would certainly solve the problem for me.
Is there a way to workaround this issue by reorganizing code, or something
else, so that I can fool the NVR smarts into not getting invoked in this
particular case?
--
reddy at pixar dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |reddy at pixar dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12076
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/12076] gcov misreports coverage of return statement [NVR]
[not found] <bug-12076-6823@http.gcc.gnu.org/bugzilla/>
2005-10-27 1:41 ` [Bug c++/12076] gcov misreports coverage of return statement [NVR] reddy at pixar dot com
@ 2006-01-21 22:33 ` jbuck at welsh-buck dot org
2007-05-04 1:34 ` [Bug c++/12076] gcov misreports coverage of return statement [NRV] pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: jbuck at welsh-buck dot org @ 2006-01-21 22:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #13 from jbuck at welsh-buck dot org 2006-01-21 22:33 -------
Subject: Re: gcov misreports coverage of return statement
[NVR]
On Thu, 2005-10-27 at 01:41 +0000, reddy at pixar dot com wrote:
>
> ------- Comment #12 from reddy at pixar dot com 2005-10-27 01:41 -------
> Having code coverage emit a "-" instead of "#####" in this case sounds
> appropriate and would certainly solve the problem for me.
>
> Is there a way to workaround this issue by reorganizing code, or something
> else, so that I can fool the NVR smarts into not getting invoked in this
> particular case?
The -fno-elide-constructors flag helps; it forces explicit copy constructor
calls, and that seems to get rid of most of the bogons -- but apparently
not all of them -- I'll look further, but I think sometimes the
initializer for a base class gets optimized in a way that results in a
false ###### flagging. Still, if you're having this trouble, start with
that flag.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12076
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/12076] gcov misreports coverage of return statement [NRV]
[not found] <bug-12076-6823@http.gcc.gnu.org/bugzilla/>
2005-10-27 1:41 ` [Bug c++/12076] gcov misreports coverage of return statement [NVR] reddy at pixar dot com
2006-01-21 22:33 ` jbuck at welsh-buck dot org
@ 2007-05-04 1:34 ` pinskia at gcc dot gnu dot org
2007-05-06 14:32 ` hubicka at gcc dot gnu dot org
` (2 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-05-04 1:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #14 from pinskia at gcc dot gnu dot org 2007-05-04 02:34 -------
*** Bug 31810 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |echristo at apple dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12076
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/12076] gcov misreports coverage of return statement [NRV]
[not found] <bug-12076-6823@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2007-05-04 1:34 ` [Bug c++/12076] gcov misreports coverage of return statement [NRV] pinskia at gcc dot gnu dot org
@ 2007-05-06 14:32 ` hubicka at gcc dot gnu dot org
2007-05-06 23:32 ` jbuck at gcc dot gnu dot org
2010-01-08 17:46 ` pinskia at gcc dot gnu dot org
5 siblings, 0 replies; 8+ messages in thread
From: hubicka at gcc dot gnu dot org @ 2007-05-06 14:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #15 from hubicka at gcc dot gnu dot org 2007-05-06 15:31 -------
The problem with NRV transformation is that it removes the return statement
from default path and keeps it in the catch path making GCOV to properly output
it as unexecuted. I tried to look into the NRV modify_expr withing return_expr
but it is not the place to find the proper locator, looks like NRV itself needs
to be updated.
Honza
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12076
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/12076] gcov misreports coverage of return statement [NRV]
[not found] <bug-12076-6823@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2007-05-06 14:32 ` hubicka at gcc dot gnu dot org
@ 2007-05-06 23:32 ` jbuck at gcc dot gnu dot org
2010-01-08 17:46 ` pinskia at gcc dot gnu dot org
5 siblings, 0 replies; 8+ messages in thread
From: jbuck at gcc dot gnu dot org @ 2007-05-06 23:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #16 from jbuck at gcc dot gnu dot org 2007-05-07 00:32 -------
The return statement, before the optimization, does two things; it causes a
copy constructor call, and it causes the function to return. NVR eliminates
the copy constructor call, but the statement still returns. At -O0, don't we
still hit a distinct return statement for the code at the given source line?
The fact that there is also unexecuted code present that executes only if
exceptions are caught should not matter, because we mark a statement as covered
if any part of it executes.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12076
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/12076] gcov misreports coverage of return statement [NRV]
[not found] <bug-12076-6823@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2007-05-06 23:32 ` jbuck at gcc dot gnu dot org
@ 2010-01-08 17:46 ` pinskia at gcc dot gnu dot org
5 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-01-08 17:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #17 from pinskia at gcc dot gnu dot org 2010-01-08 17:46 -------
*** Bug 42660 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pluto at agmk dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12076
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/12076] New: gcov misreports coverage of return statement
@ 2003-08-27 9:34 r dot lichtenberger at icoserve dot com
2005-07-25 1:52 ` [Bug c++/12076] gcov misreports coverage of return statement [NVR] pinskia at gcc dot gnu dot org
2005-07-25 21:04 ` jbuck at gcc dot gnu dot org
0 siblings, 2 replies; 8+ messages in thread
From: r dot lichtenberger at icoserve dot com @ 2003-08-27 9:34 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12076
Summary: gcov misreports coverage of return statement
Product: gcc
Version: 3.2.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: r dot lichtenberger at icoserve dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
I compiled & ran this little program:
#include <string>
#include <iostream>
std::string repeat(const std::string& p_str, unsigned int p_count)
{
std::string result;
for (unsigned int i=0;i<p_count;++i)
result+=p_str;
return result;
}
int main(void)
{
std::cout << repeat("gnu", 20) << std::endl;
return 0;
}
The line containing the return statement is marked as "not run", which cannot be:
std::string repeat(const std::string& p_str, unsigned int p_count)
1 {
1 std::string result;
21 for (unsigned int i=0;i<p_count;++i)
20 result+=p_str;
###### return result;
}
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-01-08 17:46 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-12076-6823@http.gcc.gnu.org/bugzilla/>
2005-10-27 1:41 ` [Bug c++/12076] gcov misreports coverage of return statement [NVR] reddy at pixar dot com
2006-01-21 22:33 ` jbuck at welsh-buck dot org
2007-05-04 1:34 ` [Bug c++/12076] gcov misreports coverage of return statement [NRV] pinskia at gcc dot gnu dot org
2007-05-06 14:32 ` hubicka at gcc dot gnu dot org
2007-05-06 23:32 ` jbuck at gcc dot gnu dot org
2010-01-08 17:46 ` pinskia at gcc dot gnu dot org
2003-08-27 9:34 [Bug c++/12076] New: gcov misreports coverage of return statement r dot lichtenberger at icoserve dot com
2005-07-25 1:52 ` [Bug c++/12076] gcov misreports coverage of return statement [NVR] pinskia at gcc dot gnu dot org
2005-07-25 21:04 ` jbuck at gcc dot gnu dot 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).