https://gcc.gnu.org/g:79e22e16f63882cce2074511a18672a1ca9e7dac
commit r16-3366-g79e22e16f63882cce2074511a18672a1ca9e7dac Author: Indu Bhagat <indu.bha...@oracle.com> Date: Wed Jul 9 14:23:53 2025 +0300 targhooks: i386: rename TAG_SIZE to TAG_BITSIZE gcc/Changelog: * asan.h (HWASAN_TAG_SIZE): Use targetm.memtag.tag_bitsize. * config/i386/i386.cc (ix86_memtag_tag_size): Rename to ix86_memtag_tag_bitsize. (TARGET_MEMTAG_TAG_SIZE): Renamed to TARGET_MEMTAG_TAG_BITSIZE. * doc/tm.texi (TARGET_MEMTAG_TAG_SIZE): Likewise. * doc/tm.texi.in (TARGET_MEMTAG_TAG_SIZE): Likewise. * target.def (tag_size): Rename to tag_bitsize. * targhooks.cc (default_memtag_tag_size): Rename to default_memtag_tag_bitsize. * targhooks.h (default_memtag_tag_size): Likewise. Signed-off-by: Claudiu Zissulescu <claudiu.zissulescu-iancule...@oracle.com> Co-authored-by: Claudiu Zissulescu <claudiu.zissulescu-iancule...@oracle.com> Diff: --- gcc/asan.h | 2 +- gcc/config/i386/i386.cc | 8 ++++---- gcc/doc/tm.texi | 2 +- gcc/doc/tm.texi.in | 2 +- gcc/target.def | 4 ++-- gcc/targhooks.cc | 2 +- gcc/targhooks.h | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gcc/asan.h b/gcc/asan.h index 0a3f5e927c77..a24562f67a29 100644 --- a/gcc/asan.h +++ b/gcc/asan.h @@ -103,7 +103,7 @@ extern hash_set <tree> *asan_used_labels; independently here. */ /* How many bits are used to store a tag in a pointer. The default version uses the entire top byte of a pointer (i.e. 8 bits). */ -#define HWASAN_TAG_SIZE targetm.memtag.tag_size () +#define HWASAN_TAG_SIZE targetm.memtag.tag_bitsize () /* Tag Granule of HWASAN shadow stack. This is the size in real memory that each byte in the shadow memory refers to. I.e. if a variable is X bytes long in memory then its tag in shadow diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc index b4b84b9fecba..9093f2077346 100644 --- a/gcc/config/i386/i386.cc +++ b/gcc/config/i386/i386.cc @@ -27202,9 +27202,9 @@ ix86_memtag_can_tag_addresses () return ix86_lam_type != lam_none && TARGET_LP64; } -/* Implement TARGET_MEMTAG_TAG_SIZE. */ +/* Implement TARGET_MEMTAG_TAG_BITSIZE. */ unsigned char -ix86_memtag_tag_size () +ix86_memtag_tag_bitsize () { return IX86_HWASAN_TAG_SIZE; } @@ -28178,8 +28178,8 @@ ix86_libgcc_floating_mode_supported_p #undef TARGET_MEMTAG_UNTAGGED_POINTER #define TARGET_MEMTAG_UNTAGGED_POINTER ix86_memtag_untagged_pointer -#undef TARGET_MEMTAG_TAG_SIZE -#define TARGET_MEMTAG_TAG_SIZE ix86_memtag_tag_size +#undef TARGET_MEMTAG_TAG_BITSIZE +#define TARGET_MEMTAG_TAG_BITSIZE ix86_memtag_tag_bitsize #undef TARGET_GEN_CCMP_FIRST #define TARGET_GEN_CCMP_FIRST ix86_gen_ccmp_first diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 4c338c382adc..37642680f423 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -12881,7 +12881,7 @@ At preset, this feature does not support address spaces. It also requires @code{Pmode} to be the same as @code{ptr_mode}. @end deftypefn -@deftypefn {Target Hook} uint8_t TARGET_MEMTAG_TAG_SIZE () +@deftypefn {Target Hook} uint8_t TARGET_MEMTAG_TAG_BITSIZE () Return the size of a tag (in bits) for this platform. The default returns 8. diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index 12b8ed660a08..c3ed9a9fd7c2 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -8136,7 +8136,7 @@ maintainer is familiar with. @hook TARGET_MEMTAG_CAN_TAG_ADDRESSES -@hook TARGET_MEMTAG_TAG_SIZE +@hook TARGET_MEMTAG_TAG_BITSIZE @hook TARGET_MEMTAG_GRANULE_SIZE diff --git a/gcc/target.def b/gcc/target.def index 5dd8f253ef6e..8e491d838642 100644 --- a/gcc/target.def +++ b/gcc/target.def @@ -7475,11 +7475,11 @@ At preset, this feature does not support address spaces. It also requires\n\ bool, (), default_memtag_can_tag_addresses) DEFHOOK -(tag_size, +(tag_bitsize, "Return the size of a tag (in bits) for this platform.\n\ \n\ The default returns 8.", - uint8_t, (), default_memtag_tag_size) + uint8_t, (), default_memtag_tag_bitsize) DEFHOOK (granule_size, diff --git a/gcc/targhooks.cc b/gcc/targhooks.cc index e723bbbc4df6..947e39aedc18 100644 --- a/gcc/targhooks.cc +++ b/gcc/targhooks.cc @@ -2808,7 +2808,7 @@ default_memtag_can_tag_addresses () } uint8_t -default_memtag_tag_size () +default_memtag_tag_bitsize () { return 8; } diff --git a/gcc/targhooks.h b/gcc/targhooks.h index 3fa20af0e111..34c30d4af453 100644 --- a/gcc/targhooks.h +++ b/gcc/targhooks.h @@ -310,7 +310,7 @@ extern bool speculation_safe_value_not_needed (bool); extern rtx default_speculation_safe_value (machine_mode, rtx, rtx, rtx); extern bool default_memtag_can_tag_addresses (); -extern uint8_t default_memtag_tag_size (); +extern uint8_t default_memtag_tag_bitsize (); extern uint8_t default_memtag_granule_size (); extern rtx default_memtag_insert_random_tag (rtx, rtx); extern rtx default_memtag_add_tag (rtx, poly_int64, uint8_t);