As I just  wrote, this patch needs work.  the general points are:
1) exposing integers 0-3 to the user as switch values. Don't do that, give them names. In this case a comma separated list of orthogonal names seems appropriate. But see below. 2) Poor documentation. How might the user might choose an appropriate setting? (what happens if compilations need to use different settings). What are 'edge' and 'value' counters. Why might one want different settings for them?

I think this is jumping too deep into a solution with insufficient evidence. Particularly, why two edges and values can be set differently. It doesn't lend itself to extending to TLS, if that proves to be a good solution (trading memory for time). Something along the lines of '-fprofile-update={single,atomic,threaded},[edge,value]' might be better. I.e. set the scheme as part of the option value, followed by a list of the things it applies to. (and as I hope I've implied, it'd be good not to have that separate list until proven otherwise).


On 07/28/16 08:32, marxin wrote:
libgcc/ChangeLog:

2016-07-28  Martin Liska  <mli...@suse.cz>

Shouldn't the original authors be named here too? (applies to the other patches too).


--- a/gcc/gcov-io.h
+++ b/gcc/gcov-io.h
@@ -169,6 +169,19 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  
If not, see

+
+#if LONG_LONG_TYPE_SIZE > 32
+#define GCOV_TYPE_ATOMIC_FETCH_ADD_FN __atomic_fetch_add_8
+#define GCOV_TYPE_ATOMIC_FETCH_ADD BUILT_IN_ATOMIC_FETCH_ADD_8
+#else
+#define GCOV_TYPE_ATOMIC_FETCH_ADD_FN __atomic_fetch_add_4
+#define GCOV_TYPE_ATOMIC_FETCH_ADD BUILT_IN_ATOMIC_FETCH_ADD_4
+#endif
...
 #if IN_LIBGCOV
+
+#if LONG_LONG_TYPE_SIZE > 32
+#define GCOV_TYPE_ATOMIC_FETCH_ADD_FN __atomic_fetch_add_8
+#define GCOV_TYPE_ATOMIC_FETCH_ADD BUILT_IN_ATOMIC_FETCH_ADD_8
+#else
+#define GCOV_TYPE_ATOMIC_FETCH_ADD_FN __atomic_fetch_add_4
+#define GCOV_TYPE_ATOMIC_FETCH_ADD BUILT_IN_ATOMIC_FETCH_ADD_4
+#endif


BTW, these two blocks look stunningly similar.

nathan

Reply via email to