[PATCH] middle-end/AArch64 Fix bootstrap after vec changes

Tamar Christina tamar.christina@arm.com
Fri Aug 6 10:50:35 GMT 2021


Hi All,

The build is broken since a3d3e8c362c2 since it's deleted the ability to pass
vec<> by value and now much be past by reference.

However some language hooks used by AArch64 were not updated and breaks the
build on AArch64.  This patch updates these hooks.

However most of the changes are generic... so I'm sending to a cross section
of approvers.

Bootstrapped aarch64-none-linux-gnu and works again.

Ok for master?

Thanks,
Tamar

gcc/c/ChangeLog:

	* c-decl.c (c_simulate_enum_decl): Pass vec<> by pointer.
	* c-tree.h (c_simulate_enum_decl): Likewise.

gcc/ChangeLog:

	* config/aarch64/aarch64-sve-builtins.cc (register_svpattern,
	register_svprfop): Pass vec<> by pointer.
	* langhooks-def.h (lhd_simulate_enum_decl): Likewise.
	* langhooks.c (lhd_simulate_enum_decl): Likewise.
	* langhooks.h (struct lang_hooks_for_types): Likewise.

gcc/cp/ChangeLog:

	* cp-objcp-common.h (cxx_simulate_enum_decl): Pass vec<> by pointer.
	* decl.c (cxx_simulate_enum_decl): Likewise.

--- inline copy of patch -- 
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index 234ee16fe4afe5baf3490596d27662c7acee8126..221a67fe57be105dfb88f5053179adb62c9cc47d 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -9379,7 +9379,7 @@ build_enumerator (location_t decl_loc, location_t loc,
 
 tree
 c_simulate_enum_decl (location_t loc, const char *name,
-		      vec<string_int_pair> values)
+		      vec<string_int_pair> *values_ptr)
 {
   location_t saved_loc = input_location;
   input_location = loc;
@@ -9389,6 +9389,7 @@ c_simulate_enum_decl (location_t loc, const char *name,
 
   tree value_chain = NULL_TREE;
   string_int_pair *value;
+  vec<string_int_pair> values = *values_ptr;
   unsigned int i;
   FOR_EACH_VEC_ELT (values, i, value)
     {
diff --git a/gcc/c/c-tree.h b/gcc/c/c-tree.h
index ab6db3860f5062d5d73e3ffacf123a992b9c6c48..a8a90eae30d54006e83b20cdcc7aa7a582686c6c 100644
--- a/gcc/c/c-tree.h
+++ b/gcc/c/c-tree.h
@@ -595,7 +595,7 @@ extern void finish_function (location_t = input_location);
 extern tree finish_struct (location_t, tree, tree, tree,
 			   class c_struct_parse_info *);
 extern tree c_simulate_enum_decl (location_t, const char *,
-				  vec<string_int_pair>);
+				  vec<string_int_pair> *);
 extern struct c_arg_info *build_arg_info (void);
 extern struct c_arg_info *get_parm_info (bool, tree);
 extern tree grokfield (location_t, struct c_declarator *,
diff --git a/gcc/config/aarch64/aarch64-sve-builtins.cc b/gcc/config/aarch64/aarch64-sve-builtins.cc
index f44f81f13754b2d7f7391086c846ee2f966d54a7..f71b287570e4c8c00149e864db4bf03941382672 100644
--- a/gcc/config/aarch64/aarch64-sve-builtins.cc
+++ b/gcc/config/aarch64/aarch64-sve-builtins.cc
@@ -3499,7 +3499,7 @@ register_svpattern ()
 #undef PUSH
 
   acle_svpattern = lang_hooks.types.simulate_enum_decl (input_location,
-							"svpattern", values);
+							"svpattern", &values);
 }
 
 /* Register the svprfop enum.  */
@@ -3513,7 +3513,7 @@ register_svprfop ()
 #undef PUSH
 
   acle_svprfop = lang_hooks.types.simulate_enum_decl (input_location,
-						      "svprfop", values);
+						      "svprfop", &values);
 }
 
 /* Implement #pragma GCC aarch64 "arm_sve.h".  */
diff --git a/gcc/cp/cp-objcp-common.h b/gcc/cp/cp-objcp-common.h
index 53c6e4c2c8859be51b7bbcc87ce688d35c10f602..f1704aad5578c4132bcee5b3f9799dbacb6fd114 100644
--- a/gcc/cp/cp-objcp-common.h
+++ b/gcc/cp/cp-objcp-common.h
@@ -38,7 +38,7 @@ extern bool cp_handle_option (size_t, const char *, HOST_WIDE_INT, int,
 			      location_t, const struct cl_option_handlers *);
 extern tree cxx_make_type_hook			(tree_code);
 extern tree cxx_simulate_enum_decl (location_t, const char *,
-				    vec<string_int_pair>);
+				    vec<string_int_pair> *);
 
 /* Lang hooks that are shared between C++ and ObjC++ are defined here.  Hooks
    specific to C++ or ObjC++ go in cp/cp-lang.c and objcp/objcp-lang.c,
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 6fa6b9adc8778ff641f6a1c6ca9083ee74863331..f626f1e65ee644a494eb57fa5bcb7f1eb05ff667 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -16408,7 +16408,7 @@ lookup_enumerator (tree enumtype, tree name)
 
 tree
 cxx_simulate_enum_decl (location_t loc, const char *name,
-			vec<string_int_pair> values)
+			vec<string_int_pair> *values)
 {
   location_t saved_loc = input_location;
   input_location = loc;
diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h
index 8b744d96fb23af9c16c4860a3ac1c715b292fc24..02b4681dd96e1479cad1d9a233f308c2c1acba9f 100644
--- a/gcc/langhooks-def.h
+++ b/gcc/langhooks-def.h
@@ -55,7 +55,7 @@ extern void lhd_set_decl_assembler_name (tree decl);
 extern void lhd_overwrite_decl_assembler_name (tree decl, tree name);
 extern bool lhd_warn_unused_global_decl (const_tree);
 extern tree lhd_simulate_enum_decl (location_t, const char *,
-				    vec<string_int_pair>);
+				    vec<string_int_pair> *);
 extern tree lhd_type_for_size (unsigned precision, int unsignedp);
 extern void lhd_incomplete_type_error (location_t, const_tree, const_tree);
 extern tree lhd_type_promotes_to (tree);
diff --git a/gcc/langhooks.h b/gcc/langhooks.h
index 1b417a01a4e08c5c62a969100dbdd81843dfef9e..ffd3e0bf2db588eafae3bcff551327207fa44881 100644
--- a/gcc/langhooks.h
+++ b/gcc/langhooks.h
@@ -66,7 +66,7 @@ struct lang_hooks_for_types
 
   /* Make an enum type with the given name and values, associating
      them all with the given source location.  */
-  tree (*simulate_enum_decl) (location_t, const char *, vec<string_int_pair>);
+  tree (*simulate_enum_decl) (location_t, const char *, vec<string_int_pair> *);
 
   /* Return what kind of RECORD_TYPE this is, mainly for purposes of
      debug information.  If not defined, record types are assumed to
diff --git a/gcc/langhooks.c b/gcc/langhooks.c
index d753199ffe02c6e5a5c54ad500cdd25012f1e01d..48c723777786e8bb3e3ab3c37ebe1ce296db573a 100644
--- a/gcc/langhooks.c
+++ b/gcc/langhooks.c
@@ -485,7 +485,7 @@ lhd_make_node (enum tree_code code)
    might be reusable elsewhere.  */
 tree
 lhd_simulate_enum_decl (location_t loc, const char *name,
-			vec<string_int_pair> values)
+			vec<string_int_pair> *values_ptr)
 {
   tree enumtype = lang_hooks.types.make_type (ENUMERAL_TYPE);
   tree enumdecl = build_decl (loc, TYPE_DECL, get_identifier (name), enumtype);
@@ -493,6 +493,7 @@ lhd_simulate_enum_decl (location_t loc, const char *name,
 
   tree value_chain = NULL_TREE;
   string_int_pair *value;
+  vec<string_int_pair> values = *values_ptr;
   unsigned int i;
   FOR_EACH_VEC_ELT (values, i, value)
     {


-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rb14760.patch
Type: text/x-diff
Size: 5492 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210806/65a7f711/attachment-0001.bin>


More information about the Gcc-patches mailing list