]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Make function_code a 32-bit field
authorRichard Sandiford <richard.sandiford@arm.com>
Mon, 5 Aug 2019 16:47:04 +0000 (16:47 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 5 Aug 2019 16:47:04 +0000 (16:47 +0000)
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  <richard.sandiford@arm.com>

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
gcc/tree-core.h

index 26ada9c99916a63d8a9d582cd998cf364700acde..959d15b5041698b63fd2f1d5807e60ec3a761b26 100644 (file)
@@ -1,3 +1,10 @@
+2019-08-05  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * 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  <richard.sandiford@arm.com>
 
        * gimple-fold.c (gimple_fold_mask_load_store_mem_ref)
index 60d8c68417135f4446936a23fb63d154634a8865..471956269121f96fbe27d72ff75876e8d65b298d 100644 (file)
@@ -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 {