+2016-08-17 Martin Liska <mliska@suse.cz>
+
+ * coverage.c (get_gcov_type): Replace GCOV_TYPE_SIZE with
+ a LONG_LONG_TYPE_SIZE comparison.
+ * gcov-io.h: Remove macro definitions.
+ * tree-profile.c (gimple_gen_edge_profiler): Replace usage
+ of GCOV_TYPE_ATOMIC_FETCH_ADD with a LONG_LONG_TYPE_SIZE
+ comparison.
+
2016-08-16 Jakub Jelinek <jakub@redhat.com>
* config/i386/i386.c (enum ix86_builtins): Reorder enumerators, so
tree
get_gcov_type (void)
{
- machine_mode mode = smallest_mode_for_size (GCOV_TYPE_SIZE, MODE_INT);
+ machine_mode mode
+ = smallest_mode_for_size (LONG_LONG_TYPE_SIZE > 32 ? 64 : 32, MODE_INT);
return lang_hooks.types.type_for_mode (mode, false);
}
#ifndef GCC_GCOV_IO_H
#define GCC_GCOV_IO_H
-#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
-
#ifndef IN_LIBGCOV
/* About the host */
#if IN_GCOV > 0
#include <sys/types.h>
#endif
-#else /*!IN_GCOV */
-#define GCOV_TYPE_SIZE (LONG_LONG_TYPE_SIZE > 32 ? 64 : 32)
#endif
#if defined (HOST_HAS_F_SETLKW)
{
/* __atomic_fetch_add (&counter, 1, MEMMODEL_RELAXED); */
tree addr = tree_coverage_counter_addr (GCOV_COUNTER_ARCS, edgeno);
- gcall *stmt
- = gimple_build_call (builtin_decl_explicit (GCOV_TYPE_ATOMIC_FETCH_ADD),
- 3, addr, one,
- build_int_cst (integer_type_node,
- MEMMODEL_RELAXED));
+ tree f = builtin_decl_explicit (LONG_LONG_TYPE_SIZE > 32
+ ? BUILT_IN_ATOMIC_FETCH_ADD_8:
+ BUILT_IN_ATOMIC_FETCH_ADD_4);
+ gcall *stmt = gimple_build_call (f, 3, addr, one,
+ build_int_cst (integer_type_node,
+ MEMMODEL_RELAXED));
gsi_insert_on_edge (e, stmt);
}
else