diff mbox

[Aarch64] Enable descriptors for nested functions in Ada

Message ID 3115373.5ZQ0WcpKrW@polaris
State New
Headers show

Commit Message

Eric Botcazou April 3, 2017, 9:23 a.m. UTC
> 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?

Comments

Andreas Schwab April 3, 2017, 10:32 a.m. UTC | #1
On Apr 03 2017, Eric Botcazou <ebotcazou@adacore.com> wrote:

>> 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?

Thanks, that at least fixes tasking.

Andreas.
diff mbox

Patch

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");