mirror of git://gcc.gnu.org/git/gcc.git
Do not use LONG_LONG_TYPE_SIZE in #if macro condition
* 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. From-SVN: r239522
This commit is contained in:
parent
b0c67c7678
commit
892a653cc9
|
|
@ -1,3 +1,12 @@
|
||||||
|
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>
|
2016-08-16 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
* config/i386/i386.c (enum ix86_builtins): Reorder enumerators, so
|
* config/i386/i386.c (enum ix86_builtins): Reorder enumerators, so
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,8 @@ static void coverage_obj_finish (vec<constructor_elt, va_gc> *);
|
||||||
tree
|
tree
|
||||||
get_gcov_type (void)
|
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);
|
return lang_hooks.types.type_for_mode (mode, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -164,14 +164,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||||
#ifndef GCC_GCOV_IO_H
|
#ifndef GCC_GCOV_IO_H
|
||||||
#define 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
|
#ifndef IN_LIBGCOV
|
||||||
/* About the host */
|
/* About the host */
|
||||||
|
|
||||||
|
|
@ -185,8 +177,6 @@ typedef uint64_t gcov_type_unsigned;
|
||||||
#if IN_GCOV > 0
|
#if IN_GCOV > 0
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#endif
|
#endif
|
||||||
#else /*!IN_GCOV */
|
|
||||||
#define GCOV_TYPE_SIZE (LONG_LONG_TYPE_SIZE > 32 ? 64 : 32)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined (HOST_HAS_F_SETLKW)
|
#if defined (HOST_HAS_F_SETLKW)
|
||||||
|
|
|
||||||
|
|
@ -259,11 +259,12 @@ gimple_gen_edge_profiler (int edgeno, edge e)
|
||||||
{
|
{
|
||||||
/* __atomic_fetch_add (&counter, 1, MEMMODEL_RELAXED); */
|
/* __atomic_fetch_add (&counter, 1, MEMMODEL_RELAXED); */
|
||||||
tree addr = tree_coverage_counter_addr (GCOV_COUNTER_ARCS, edgeno);
|
tree addr = tree_coverage_counter_addr (GCOV_COUNTER_ARCS, edgeno);
|
||||||
gcall *stmt
|
tree f = builtin_decl_explicit (LONG_LONG_TYPE_SIZE > 32
|
||||||
= gimple_build_call (builtin_decl_explicit (GCOV_TYPE_ATOMIC_FETCH_ADD),
|
? BUILT_IN_ATOMIC_FETCH_ADD_8:
|
||||||
3, addr, one,
|
BUILT_IN_ATOMIC_FETCH_ADD_4);
|
||||||
build_int_cst (integer_type_node,
|
gcall *stmt = gimple_build_call (f, 3, addr, one,
|
||||||
MEMMODEL_RELAXED));
|
build_int_cst (integer_type_node,
|
||||||
|
MEMMODEL_RELAXED));
|
||||||
gsi_insert_on_edge (e, stmt);
|
gsi_insert_on_edge (e, stmt);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue