From: Sebastian Huber Date: Fri, 6 Aug 2021 07:57:43 +0000 (+0200) Subject: gcov: Remove from libgcov-driver.c X-Git-Tag: basepoints/gcc-13~5529 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c94db20be9af3cb0376292e2d4672b515558231;p=thirdparty%2Fgcc.git gcov: Remove from libgcov-driver.c In the patch to add __gcov_info_to_gcda(), the include of was added to libgcov-driver.c even if inhibit_libc is defined. It turned out that this header file is not always available. Remove the include of and replace the intptr_t with the compiler provided __INTPTR_TYPE__. libgcc/ * libgcov-driver.c (#include ): Remove. (write_topn_counters): Use __INTPTR_TYPE__ instead of intptr_t. --- diff --git a/libgcc/libgcov-driver.c b/libgcc/libgcov-driver.c index 9d7bc9c79950..087f71e01077 100644 --- a/libgcc/libgcov-driver.c +++ b/libgcc/libgcov-driver.c @@ -26,8 +26,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgcov.h" #include "gcov-io.h" -#include - /* Return 1, if all counter values are zero, otherwise 0. */ static inline int @@ -453,7 +451,7 @@ write_topn_counters (const struct gcov_ctr_info *ci_ptr, gcov_type start = ci_ptr->values[GCOV_TOPN_MEM_COUNTERS * i + 2]; unsigned sizes = 0; - for (struct gcov_kvp *node = (struct gcov_kvp *)(intptr_t)start; + for (struct gcov_kvp *node = (struct gcov_kvp *)(__INTPTR_TYPE__)start; node != NULL; node = node->next) ++sizes; @@ -472,7 +470,7 @@ write_topn_counters (const struct gcov_ctr_info *ci_ptr, gcov_type start = ci_ptr->values[GCOV_TOPN_MEM_COUNTERS * i + 2]; unsigned j = 0; - for (struct gcov_kvp *node = (struct gcov_kvp *)(intptr_t)start; + for (struct gcov_kvp *node = (struct gcov_kvp *)(__INTPTR_TYPE__)start; j < list_sizes[i]; node = node->next, j++) { dump_counter (node->value, dump_fn, arg);