This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Aarch64] Enable descriptors for nested functions in Ada


> In which way are the bits reserved?

I don't know, but that's what I was told by the ARM folks.

> This does not work for ILP32, because the descriptor address starts off
> at address 4 modulo 8, and adding 4 clears the bit.

I see, can you try the attached patchlet?

-- 
Eric Botcazou
Index: tree-nested.c
===================================================================
--- tree-nested.c	(revision 246276)
+++ tree-nested.c	(working copy)
@@ -496,6 +496,8 @@ static GTY(()) tree descriptor_type;
 static tree
 get_descriptor_type (struct nesting_info *info)
 {
+  /* The base alignment is that of a function.  */
+  const unsigned align = FUNCTION_ALIGNMENT (FUNCTION_BOUNDARY);
   tree t;
 
   if (descriptor_type)
@@ -505,6 +507,9 @@ get_descriptor_type (struct nesting_info
   t = build_array_type (ptr_type_node, t);
   t = build_decl (DECL_SOURCE_LOCATION (info->context),
 		  FIELD_DECL, get_identifier ("__data"), t);
+  if (DECL_ALIGN (t) < align)
+    SET_DECL_ALIGN (t, align);
+  DECL_USER_ALIGN (t) = 1;
 
   descriptor_type = make_node (RECORD_TYPE);
   TYPE_NAME (descriptor_type) = get_identifier ("__builtin_descriptor");

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]