This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16855] gcov does not report the fact that static destructors actually run.
- From: "marxin at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 27 Sep 2016 11:07:47 +0000
- Subject: [Bug c++/16855] gcov does not report the fact that static destructors actually run.
- Auto-submitted: auto-generated
- References: <bug-16855-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16855
--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Author: marxin
Date: Tue Sep 27 11:07:11 2016
New Revision: 240529
URL: https://gcc.gnu.org/viewcvs?rev=240529&root=gcc&view=rev
Log:
gcov: dump in a static dtor instead of in an atexit handler
PR gcov-profile/7970
PR gcov-profile/16855
PR gcov-profile/44779
* g++.dg/gcov/pr16855.C: New test.
* coverage.c (build_gcov_exit_decl): New function.
(coverage_obj_init): Call the function and generate __gcov_exit
destructor.
* doc/gcov.texi: Document when __gcov_exit function is called.
* libgcov-driver.c (__gcov_init): Do not register a atexit
handler.
(__gcov_exit): Rename from gcov_exit.
* libgcov.h (__gcov_exit): Declare.
Added:
trunk/gcc/testsuite/g++.dg/gcov/pr16855.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/coverage.c
trunk/gcc/doc/gcov.texi
trunk/gcc/testsuite/ChangeLog
trunk/libgcc/ChangeLog
trunk/libgcc/libgcov-driver.c
trunk/libgcc/libgcov.h