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: [RFC] Add aarch64 support for ada


On 16 Apr 2014, at 17:36, Richard Henderson <rth@redhat.com> wrote:

> On 04/16/2014 12:39 AM, Eric Botcazou wrote:
>>> The primary bit of rfc here is the hunk that applies to ada/types.h
>>> with respect to Fat_Pointer.  Given that the Ada type, as defined in
>>> s-stratt.ads, does not include alignment, I can't imagine why the C
>>> type should have it.
>> 
>> See gcc-interface/utils.c:finish_fat_pointer_type.
> 
> Ah hah.
> 
>  /* Make sure we can put it into a register.  */
>  if (STRICT_ALIGNMENT)
>    TYPE_ALIGN (record_type) = MIN (BIGGEST_ALIGNMENT, 2 * POINTER_SIZE);
> 
> AArch64 is not a STRICT_ALIGNMENT target, thus the mismatch.

As the align attribute in types.h is for the host, couldn't a configure test solve
this issue ?

> If we were to make this alignment unconditional, would it be better to drop the
> code from here in finish_fat_pointer_type and instead record that in the Ada
> source, as we do with the C source?
> 
> I presume
> 
>  for Fat_Pointer'Alignment use System.Address'Size * 2;
> 
> or some such incantation would do that...

One of the most common Fat_Pointer is for strings, which aren't declared in any
source and is very commonly used.

OTOH, I think this optimization mostly targets sparc.

Tristan.


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