libgcov-driver.c is also compiled into gcov-tool by the host compiler,
which need not predefine __INTPTR_TYPE__. libgcov.h already uses
intptr_t for the same conversions.
Bootstrapped and regression-tested on x86_64-pc-linux-gnu
(default languages, --disable-multilib), with no new regressions
relative to the unmodified baseline.
Also tested with a non-GCC, EDG-based host compiler (GNU extensions
disabled) on a non-glibc platform, where the patch resolves a build
failure.
libgcc/ChangeLog:
* libgcov-driver.c (write_topn_counters): Use intptr_t instead of
__INTPTR_TYPE__.
Signed-off-by: Shiva <[email protected]>
---
libgcc/libgcov-driver.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libgcc/libgcov-driver.c b/libgcc/libgcov-driver.c
index 9b305de2e7a..fb47b4a51a6 100644
--- a/libgcc/libgcov-driver.c
+++ b/libgcc/libgcov-driver.c
@@ -472,7 +472,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_TYPE__)start;
+ for (struct gcov_kvp *node = (struct gcov_kvp *)(intptr_t)start;
node != NULL; node = node->next)
++sizes;
@@ -491,7 +491,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_TYPE__)start;
+ for (struct gcov_kvp *node = (struct gcov_kvp *)(intptr_t)start;
j < list_sizes[i]; node = node->next, j++)
{
dump_counter (node->value, dump_fn, arg);