public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug gcov-profile/64634] New: gcov reports catch(...) as not executed
@ 2015-01-16 18:21 joerg.richter@pdv-fs.de
  2015-01-19 11:07 ` [Bug gcov-profile/64634] [4.8/4.9/5 Regression] " rguenth at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: joerg.richter@pdv-fs.de @ 2015-01-16 18:21 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 64634
           Summary: gcov reports catch(...) as not executed
           Product: gcc
           Version: 4.8.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: gcov-profile
          Assignee: unassigned at gcc dot gnu.org
          Reporter: joerg.richter@pdv-fs.de

cat > t.cc <<EOF
#include <cstdlib>
void catchEx()
{
  exit(0);
  try
  {}
  catch( int )
  {}
}

int main()
{
  try
  {
    throw 5;
  }
  catch(...)
  {
    catchEx();
  }
}
EOF

g++ -o t t.cc -O0 --coverage -g
./t

-----

If you now call gcov like this:
gcov -b t.gcda

t.cc.gcov looks like this:

...
    =====:   18:  catch(...)
call    0 never executed
call    1 never executed
call    2 returned 100%
call    3 never executed
...

But if you call gcov like this:
gcov -a -b t.gcda
Then t.cc.gcov looks like this:

...
        1:   18:  catch(...)
    %%%%%:   18-block  0
call    0 never executed
call    1 never executed
    1:   18-block  1
    1:   18-block  2
call    2 returned 100%
    %%%%%:   18-block  3
call    3 never executed
...

Note that in the former case the catch(...) on line 18 is 
marked as not executed and in the later it is marked as 
executed. This results in wrong coverage information.

Calling gcov always with -a is no option for us. Because
gcov -a is much slower.

Works with GCC 4.4.4.  Fails since 4.5.


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

end of thread, other threads:[~2015-06-03 21:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-16 18:21 [Bug gcov-profile/64634] New: gcov reports catch(...) as not executed joerg.richter@pdv-fs.de
2015-01-19 11:07 ` [Bug gcov-profile/64634] [4.8/4.9/5 Regression] " rguenth at gcc dot gnu.org
2015-02-18 14:23 ` jakub at gcc dot gnu.org
2015-02-18 16:22 ` jakub at gcc dot gnu.org
2015-02-18 22:04 ` jakub at gcc dot gnu.org
2015-02-18 22:06 ` [Bug gcov-profile/64634] [4.8/4.9 " jakub at gcc dot gnu.org
2015-03-17  8:45 ` joerg.richter@pdv-fs.de
2015-06-03 21:33 ` jakub at gcc dot gnu.org
2015-06-03 21:41 ` jakub 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).