public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-5576] gcov: Remove TARGET_GCOV_TYPE_SIZE target hook
@ 2023-11-18 11:45 Sebastian Huber
  0 siblings, 0 replies; only message in thread
From: Sebastian Huber @ 2023-11-18 11:45 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:23d33775f9225e6e8efac730fe3cf286c19fddea

commit r14-5576-g23d33775f9225e6e8efac730fe3cf286c19fddea
Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date:   Sat Oct 21 13:00:19 2023 +0200

    gcov: Remove TARGET_GCOV_TYPE_SIZE target hook
    
    This reverts commit 8cdcea51c0fd753e6a652c9b236e91b3a6e0911c.
    
    gcc/c-family/ChangeLog:
    
            * c-cppbuiltin.cc (c_cpp_builtins): Do not define
            __LIBGCC_GCOV_TYPE_SIZE.
    
    gcc/ChangeLog:
    
            * config/sparc/rtemself.h (SPARC_GCOV_TYPE_SIZE): Remove.
            * config/sparc/sparc.cc (sparc_gcov_type_size): Likewise.
            (TARGET_GCOV_TYPE_SIZE): Likewise.
            * coverage.cc (get_gcov_type): Use LONG_LONG_TYPE_SIZE instead
            of removed target hook.
            * doc/tm.texi: Regenerate.
            * doc/tm.texi.in (TARGET_GCOV_TYPE_SIZE): Remove.
            * target.def: Likewise.
            * targhooks.cc (default_gcov_type_size): Likewise.
            * targhooks.h (default_gcov_type_size): Likewise.
    
    libgcc/ChangeLog:
    
            * libgcov.h (gcov_type): Use LONG_LONG_TYPE_SIZE.
            (gcov_type_unsigned): Likewise.

Diff:
---
 gcc/c-family/c-cppbuiltin.cc |  2 --
 gcc/config/sparc/rtemself.h  |  2 --
 gcc/config/sparc/sparc.cc    | 11 -----------
 gcc/coverage.cc              |  2 +-
 gcc/doc/tm.texi              | 11 -----------
 gcc/doc/tm.texi.in           |  2 --
 gcc/target.def               | 12 ------------
 gcc/targhooks.cc             |  7 -------
 gcc/targhooks.h              |  2 --
 libgcc/libgcov.h             |  6 +++---
 10 files changed, 4 insertions(+), 53 deletions(-)

diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc
index e48b5b4ab11..5a5309d0d09 100644
--- a/gcc/c-family/c-cppbuiltin.cc
+++ b/gcc/c-family/c-cppbuiltin.cc
@@ -1567,8 +1567,6 @@ c_cpp_builtins (cpp_reader *pfile)
       /* For libgcov.  */
       builtin_define_with_int_value ("__LIBGCC_VTABLE_USES_DESCRIPTORS__",
 				     TARGET_VTABLE_USES_DESCRIPTORS);
-      builtin_define_with_int_value ("__LIBGCC_GCOV_TYPE_SIZE",
-				     targetm.gcov_type_size());
     }
 
   /* For use in assembly language.  */
diff --git a/gcc/config/sparc/rtemself.h b/gcc/config/sparc/rtemself.h
index bf4682238ae..28400a36126 100644
--- a/gcc/config/sparc/rtemself.h
+++ b/gcc/config/sparc/rtemself.h
@@ -40,5 +40,3 @@
 
 /* Use the default */
 #undef LINK_GCC_C_SEQUENCE_SPEC
-
-#define SPARC_GCOV_TYPE_SIZE 32
diff --git a/gcc/config/sparc/sparc.cc b/gcc/config/sparc/sparc.cc
index 82e57952414..e90739d0f12 100644
--- a/gcc/config/sparc/sparc.cc
+++ b/gcc/config/sparc/sparc.cc
@@ -972,17 +972,6 @@ char sparc_hard_reg_printed[8];
 #undef TARGET_ZERO_CALL_USED_REGS
 #define TARGET_ZERO_CALL_USED_REGS sparc_zero_call_used_regs
 
-#ifdef SPARC_GCOV_TYPE_SIZE
-static HOST_WIDE_INT
-sparc_gcov_type_size (void)
-{
-  return SPARC_GCOV_TYPE_SIZE;
-}
-
-#undef TARGET_GCOV_TYPE_SIZE
-#define TARGET_GCOV_TYPE_SIZE sparc_gcov_type_size
-#endif
-
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 /* Return the memory reference contained in X if any, zero otherwise.  */
diff --git a/gcc/coverage.cc b/gcc/coverage.cc
index 7ed3a5d4ceb..ad55f0f1909 100644
--- a/gcc/coverage.cc
+++ b/gcc/coverage.cc
@@ -138,7 +138,7 @@ tree
 get_gcov_type (void)
 {
   scalar_int_mode mode
-    = smallest_int_mode_for_size (targetm.gcov_type_size ());
+    = smallest_int_mode_for_size (LONG_LONG_TYPE_SIZE > 32 ? 64 : 32);
   return lang_hooks.types.type_for_mode (mode, false);
 }
 
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index d83ca73b1af..56d64a04640 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -12601,17 +12601,6 @@ Store the result in @var{target} if convenient.
 The default clears the top byte of the original pointer.
 @end deftypefn
 
-@deftypefn {Target Hook} HOST_WIDE_INT TARGET_GCOV_TYPE_SIZE (void)
-Returns the gcov type size in bits.  This type is used for example for
-counters incremented by profiling and code-coverage events.  The default
-value is 64, if the type size of long long is greater than 32, otherwise the
-default value is 32.  A 64-bit type is recommended to avoid overflows of the
-counters.  If the @option{-fprofile-update=atomic} is used, then the
-counters are incremented using atomic operations.  Targets not supporting
-64-bit atomic operations may override the default value and request a 32-bit
-type.
-@end deftypefn
-
 @deftypevr {Target Hook} bool TARGET_HAVE_SHADOW_CALL_STACK
 This value is true if the target platform supports
 @option{-fsanitize=shadow-call-stack}.  The default value is false.
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index 3d3ae12cc2f..fb0120fa1bf 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -8040,6 +8040,4 @@ maintainer is familiar with.
 
 @hook TARGET_MEMTAG_UNTAGGED_POINTER
 
-@hook TARGET_GCOV_TYPE_SIZE
-
 @hook TARGET_HAVE_SHADOW_CALL_STACK
diff --git a/gcc/target.def b/gcc/target.def
index 0996da0f71a..db87e7d39df 100644
--- a/gcc/target.def
+++ b/gcc/target.def
@@ -7243,18 +7243,6 @@ DEFHOOK
  void, (void),
  NULL)
 
-DEFHOOK
-(gcov_type_size,
- "Returns the gcov type size in bits.  This type is used for example for\n\
-counters incremented by profiling and code-coverage events.  The default\n\
-value is 64, if the type size of long long is greater than 32, otherwise the\n\
-default value is 32.  A 64-bit type is recommended to avoid overflows of the\n\
-counters.  If the @option{-fprofile-update=atomic} is used, then the\n\
-counters are incremented using atomic operations.  Targets not supporting\n\
-64-bit atomic operations may override the default value and request a 32-bit\n\
-type.",
- HOST_WIDE_INT, (void), default_gcov_type_size)
-
 /* This value represents whether the shadow call stack is implemented on
    the target platform.  */
 DEFHOOKPOD
diff --git a/gcc/targhooks.cc b/gcc/targhooks.cc
index 4f5b240f8d6..6b5173bcdd4 100644
--- a/gcc/targhooks.cc
+++ b/gcc/targhooks.cc
@@ -2778,11 +2778,4 @@ default_memtag_untagged_pointer (rtx tagged_pointer, rtx target)
   return untagged_base;
 }
 
-/* The default implementation of TARGET_GCOV_TYPE_SIZE.  */
-HOST_WIDE_INT
-default_gcov_type_size (void)
-{
-  return TYPE_PRECISION (long_long_integer_type_node) > 32 ? 64 : 32;
-}
-
 #include "gt-targhooks.h"
diff --git a/gcc/targhooks.h b/gcc/targhooks.h
index 189549cb1c7..0b35e8a96ab 100644
--- a/gcc/targhooks.h
+++ b/gcc/targhooks.h
@@ -302,6 +302,4 @@ extern rtx default_memtag_set_tag (rtx, rtx, rtx);
 extern rtx default_memtag_extract_tag (rtx, rtx);
 extern rtx default_memtag_untagged_pointer (rtx, rtx);
 
-extern HOST_WIDE_INT default_gcov_type_size (void);
-
 #endif /* GCC_TARGHOOKS_H */
diff --git a/libgcc/libgcov.h b/libgcc/libgcov.h
index 92df440d401..763118ea5b5 100644
--- a/libgcc/libgcov.h
+++ b/libgcc/libgcov.h
@@ -52,7 +52,7 @@
 #if __CHAR_BIT__ == 8
 typedef unsigned gcov_unsigned_t __attribute__ ((mode (SI)));
 typedef unsigned gcov_position_t __attribute__ ((mode (SI)));
-#if __LIBGCC_GCOV_TYPE_SIZE > 32
+#if LONG_LONG_TYPE_SIZE > 32
 typedef signed gcov_type __attribute__ ((mode (DI)));
 typedef unsigned gcov_type_unsigned __attribute__ ((mode (DI)));
 #else
@@ -63,7 +63,7 @@ typedef unsigned gcov_type_unsigned __attribute__ ((mode (SI)));
 #if __CHAR_BIT__ == 16
 typedef unsigned gcov_unsigned_t __attribute__ ((mode (HI)));
 typedef unsigned gcov_position_t __attribute__ ((mode (HI)));
-#if __LIBGCC_GCOV_TYPE_SIZE > 32
+#if LONG_LONG_TYPE_SIZE > 32
 typedef signed gcov_type __attribute__ ((mode (SI)));
 typedef unsigned gcov_type_unsigned __attribute__ ((mode (SI)));
 #else
@@ -73,7 +73,7 @@ typedef unsigned gcov_type_unsigned __attribute__ ((mode (HI)));
 #else
 typedef unsigned gcov_unsigned_t __attribute__ ((mode (QI)));
 typedef unsigned gcov_position_t __attribute__ ((mode (QI)));
-#if __LIBGCC_GCOV_TYPE_SIZE > 32
+#if LONG_LONG_TYPE_SIZE > 32
 typedef signed gcov_type __attribute__ ((mode (HI)));
 typedef unsigned gcov_type_unsigned __attribute__ ((mode (HI)));
 #else

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-18 11:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-18 11:45 [gcc r14-5576] gcov: Remove TARGET_GCOV_TYPE_SIZE target hook Sebastian Huber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).