Hi. My attempt in the following small series is to cover couple of issues I've recently observed. I'll briefly describe changes in respect to an individual patch:
marxin (4): Cherry-pick fprofile-generate-atomic from google/gcc-4_9 branch As mentioned in [1], our current implementation can produce a corrupted profile due to a massive usage of threads. Well, the absolutely robust solution would be to either utilize TLS or to use atomics & locking mechanism. However, as David Li pointed out, the most interesting counters that can suffer from multithreading are -fprofile-arcs counters and indirect call counters. I've just cherry picked the functionality from google/gcc-4_9 branch. [1] https://gcc.gnu.org/ml/gcc/2016-07/msg00131.html Remove __gcov_indirect_call_profiler The profiler function is unused, thus can be removed. Fix typo in gcov.texi Just a small typo in names of functions that one can call from a user application. Add tests for __gcov_dump and __gcov_reset Adding tests for the aforementioned functions. Patch can bootstrap on ppc64le-redhat-linux and survives regression tests (tested together). Thoughts? Thanks, Martin marxin (4): Cherry-pick fprofile-generate-atomic from google/gcc-4_9 branch Remove __gcov_indirect_call_profiler Fix typo in gcov.texi Add tests for __gcov_dump and __gcov_reset gcc/common.opt | 9 ++++ gcc/doc/gcov-tool.texi | 2 +- gcc/doc/gcov.texi | 6 +-- gcc/doc/invoke.texi | 11 +++++ gcc/gcov-io.h | 22 ++++++++++ gcc/testsuite/g++.dg/gcov/gcov-dump-1.C | 23 ++++++++++ gcc/testsuite/g++.dg/gcov/gcov-dump-2.C | 32 ++++++++++++++ gcc/testsuite/g++.dg/gcov/gcov-threads-1.C | 46 ++++++++++++++++++++ gcc/tree-profile.c | 62 ++++++++++++++++++--------- libgcc/Makefile.in | 6 ++- libgcc/libgcov-profiler.c | 67 ++++++++++++++++++------------ libgcc/libgcov-util.c | 3 +- libgcc/libgcov.h | 4 +- 13 files changed, 238 insertions(+), 55 deletions(-) create mode 100644 gcc/testsuite/g++.dg/gcov/gcov-dump-1.C create mode 100644 gcc/testsuite/g++.dg/gcov/gcov-dump-2.C create mode 100644 gcc/testsuite/g++.dg/gcov/gcov-threads-1.C -- 2.9.2