This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12076] gcov misreports coverage of return statement [NRV]
- From: "jbuck at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 May 2007 23:32:43 -0000
- Subject: [Bug c++/12076] gcov misreports coverage of return statement [NRV]
- References: <bug-12076-6823@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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