diff mbox series

[pushed] libgcov: use proper type for n_functions

Message ID 23c0c2fb-a014-5fed-d2b0-4e6056954fec@suse.cz
State New
Headers show
Series [pushed] libgcov: use proper type for n_functions | expand

Commit Message

Martin Liška May 10, 2022, 8:59 a.m. UTC
gcov_info::n_functions type is initialized by generated
code in build_info_type:

/* n_functions */
field = build_decl (BUILTINS_LOCATION, FIELD_DECL, NULL_TREE,
		    get_gcov_unsigned_t ());

It uses gcov_unsigned_t, but the struct definition in libgcov.h uses
unsigned type. That brings troubled on 16-bit targets.

I'm going to install the patch once tests finish.
Martin

	PR gcov-profile/105535

libgcc/ChangeLog:

	* libgcov.h (struct gcov_info): Use gcov_unsigned_t for
	n_functions.

Co-Authored-By: Hans-Peter Helfert <peter-helfert@t-online.de>
---
 libgcc/libgcov.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libgcc/libgcov.h b/libgcc/libgcov.h
index 487bd1464cd..c7545cc746e 100644
--- a/libgcc/libgcov.h
+++ b/libgcc/libgcov.h
@@ -235,7 +235,7 @@  struct gcov_info
   gcov_merge_fn merge[GCOV_COUNTERS];  /* merge functions (null for
 					  unused) */
   
-  unsigned n_functions;		/* number of functions */
+  gcov_unsigned_t n_functions;		/* number of functions */
 
 #ifndef IN_GCOV_TOOL
   const struct gcov_fn_info *const *functions; /* pointer to pointers