Hi Martin, > On 08/12/2016 04:08 PM, Martin Liška wrote: >> On 08/10/2016 02:53 PM, Nathan Sidwell wrote: >>> On 08/10/16 06:43, Martin Liška wrote: >>>> Hello. >>>> >>>> There are multiple PRs (mentioned in ChangeLog) which suffer from >>>> missing capability of gcov >>>> to save counters for functions with constructor/destructor >>>> attributes. I done that by simply >>>> replacing atexit handler (gcov_exit) with a new static destructor >>>> (__gcov_exit), which has >>>> priority 99 (I did the same for __gcov_init). However, I'm not sure >>>> whether it's possible >>>> that a ctor defined in a source file can be potentially executed before >>>> __gcov_init (w/ the default >>>> priority)? >>>> >>>> Patch survives: >>>> make check -k -j10 RUNTESTFLAGS="gcov.exp" >>>> make check -k -j10 RUNTESTFLAGS="tree-prof.exp" >>>> >>>> I've just also verified that a DSO gcov dump works as before. I'm >>>> attaching a test-case which >>>> tests both static ctors/dtors, as well as C++ ctors/dtors. >>> >>> Does a coverage bootstrap (--enable-coverage) still succeed? >> >> Well, looks results are more unstable than I thought. >> Even running 'make -j1' in objdir/x86_64-pc-linux-gnu/libgcc repeatedly >> generates different results. >> I'll dig in after weekend. >> >> Martin [...] >>> I think this is a good idea, but we should document the changed >>> behavior. (I don't think the current behaviour's documented). > > I'm adding a new hunk that documents the behavior. > > Is the patch ready to be installed?
the testcase FAILs on Solaris 12 (both SPARC and x86): +FAIL: g++.dg/gcov/pr16855.C -std=gnu++11 gcov: 1 failures in line counts, 0 i n branch percentages, 0 in return percentages, 0 in intermediate format +FAIL: g++.dg/gcov/pr16855.C -std=gnu++11 line 21: is #####:should be 1 +FAIL: g++.dg/gcov/pr16855.C -std=gnu++14 gcov: 1 failures in line counts, 0 i n branch percentages, 0 in return percentages, 0 in intermediate format +FAIL: g++.dg/gcov/pr16855.C -std=gnu++14 line 21: is #####:should be 1 +FAIL: g++.dg/gcov/pr16855.C -std=gnu++98 gcov: 1 failures in line counts, 0 i n branch percentages, 0 in return percentages, 0 in intermediate format +FAIL: g++.dg/gcov/pr16855.C -std=gnu++98 line 21: is #####:should be 1 I haven't looked closer yet, but notice that you require constructor priority support which isn't available everywhere (it is on Solaris 12, but not before). Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University