https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44779
--- Comment #8 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