From 55f863c4d694deafb968dbf44d08ba49bb7c0766 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Mon, 5 Aug 2019 16:47:04 +0000 Subject: [PATCH] Make function_code a 32-bit field Adding SVE intrinsics on top of the existing AArch64 intrinsics blows the 12-bit function_code in tree_function_decl. That bitfield has no spare bits, but it comes at the end of the structure and is preceded by a pointer, so on LP64 hosts there's currently a 32-bit hole at end. This patch therefore makes function_code an independent field and moves the bitfield to the 32-bit hole. I wondered about instead making function_code 16 bits, so that the patch leaves 28 spare bits instead of just 12. That seemed a bit short-term though; I can't guarantee that we won't blow 16 bits once the SVE2 functions are added... If we run out of bits again, we can start chomping from the top of the enum. E.g. 24 bits should surely be enough, but there's no point paying the overhead of the masking until we need it. 2019-08-05 Richard Sandiford gcc/ * tree-core.h (tree_function_decl): Make function_code an independent field. Group the remaining bitfields into bytes and move decl_type so that it contines to be at a byte boundary. Leave 12 bits for future expansion. From-SVN: r274119 --- gcc/ChangeLog | 7 +++++++ gcc/tree-core.h | 20 ++++++++------------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 26ada9c..959d15b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 2019-08-05 Richard Sandiford + * tree-core.h (tree_function_decl): Make function_code an + independent field. Group the remaining bitfields into bytes + and move decl_type so that it contines to be at a byte boundary. + Leave 12 bits for future expansion. + +2019-08-05 Richard Sandiford + * gimple-fold.c (gimple_fold_mask_load_store_mem_ref) (gimple_fold_mask_load, gimple_fold_mask_store): New functions. (gimple_fold_call): Use them to fold IFN_MASK_LOAD and diff --git a/gcc/tree-core.h b/gcc/tree-core.h index 60d8c68..4719562 100644 --- a/gcc/tree-core.h +++ b/gcc/tree-core.h @@ -1857,36 +1857,32 @@ struct GTY(()) tree_function_decl { tree vindex; /* In a FUNCTION_DECL for which DECL_BUILT_IN holds, this is - DECL_FUNCTION_CODE. Otherwise unused. - ??? The bitfield needs to be able to hold all target function - codes as well. */ - ENUM_BITFIELD(built_in_function) function_code : 12; - ENUM_BITFIELD(built_in_class) built_in_class : 2; + DECL_FUNCTION_CODE. Otherwise unused. */ + enum built_in_function function_code; + ENUM_BITFIELD(built_in_class) built_in_class : 2; unsigned static_ctor_flag : 1; unsigned static_dtor_flag : 1; - unsigned uninlinable : 1; unsigned possibly_inlined : 1; unsigned novops_flag : 1; unsigned returns_twice_flag : 1; + unsigned malloc_flag : 1; unsigned declared_inline_flag : 1; unsigned no_inline_warning_flag : 1; - unsigned no_instrument_function_entry_exit : 1; - - /* Align the bitfield to boundary of a byte. */ - ENUM_BITFIELD(function_decl_type) decl_type: 2; - unsigned no_limit_stack : 1; unsigned disregard_inline_limits : 1; unsigned pure_flag : 1; unsigned looping_const_or_pure_flag : 1; + + /* Align the bitfield to boundary of a byte. */ + ENUM_BITFIELD(function_decl_type) decl_type: 2; unsigned has_debug_args_flag : 1; unsigned versioned_function : 1; - /* 0 bits left. */ + /* 12 bits left for future expansion. */ }; struct GTY(()) tree_translation_unit_decl { -- 2.7.4