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][1/4] Enable tree-stdarg pass for AArch64 by defining counter fields


On Fri, May 06, 2016 at 04:00:13PM +0100, Jiong Wang wrote:
> This patch initialize va_list_gpr_counter_field and
> va_list_fpr_counter_field properly for AArch64 backend that tree-stdarg
> pass will be enabled.
> 
> The "required register" analysis is largely target independent, but the
> user might operate on the inner offset field in vaarg structure directly,
> for example:
> 
>   d = __builtin_va_arg (ap, int);
>   ap.__gr_offs += 0x20;
>   e = __builtin_va_arg (ap, int);
> 
> in which case tree-stdarg require us to tell him what's the backend offset
> field inside vaarg structure that it can still figure out we actually need
> to save 6 general registers.
> 
> ok for upstream?

I have a small comment issue for you to fix, otherwise this is OK.

> 2016-05-06  Jiong Wang  <jiong.wang@arm.com>
> gcc/
>   * config/aarch64/aarch64.c (aarch64_build_builtin_va_list): Initialize
>   va_list_gpr_counter_field and va_list_fpr_counter_field.
> 
> gcc/testsuite/
>   * gcc.dg/tree-ssa/stdarg-2.c: Enable all testcases for AArch64.
>   * gcc.dg/tree-ssa/stdarg-3.c: Likewise.
>   * gcc.dg/tree-ssa/stdarg-4.c: Likewise.
>   * gcc.dg/tree-ssa/stdarg-5.c: Likewise.
>   * gcc.dg/tree-ssa/stdarg-6.c: Likewise.
> 
>
> diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
> index 9995494..aff4a95 100644
> --- a/gcc/config/aarch64/aarch64.c
> +++ b/gcc/config/aarch64/aarch64.c
> @@ -9463,6 +9463,13 @@ aarch64_build_builtin_va_list (void)
>  			FIELD_DECL, get_identifier ("__vr_offs"),
>  			integer_type_node);
>  
> +  /* Tell tree-stdarg pass what's our internal offset fields.

This doesn't read quite right, how about something like:

  "Tell tree-stdarg pass about our internal offset fields."

Thanks,
James


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