[PATCH] AArch64: Add if condition in aarch64_function_value [PR96479]

Christophe Lyon christophe.lyon@linaro.org
Thu Aug 13 11:43:02 GMT 2020


Hi,


On Thu, 13 Aug 2020 at 03:54, qiaopeixin <qiaopeixin@huawei.com> wrote:
>
> Thanks for the review and commit.
>
> All the best,
> Peixin
>
> -----Original Message-----
> From: Richard Sandiford [mailto:richard.sandiford@arm.com]
> Sent: 2020年8月13日 0:25
> To: qiaopeixin <qiaopeixin@huawei.com>
> Cc: gcc-patches@gcc.gnu.org
> Subject: Re: [PATCH] AArch64: Add if condition in aarch64_function_value [PR96479]
>
> qiaopeixin <qiaopeixin@huawei.com> writes:
> > Hi,
> >
> > The test case vector-subscript-2.c in the gcc testsuit will report an ICE in the expand pass since '-mgeneral-regs-only' is incompatible with the use of V4SI mode. I propose to report the diagnostic information instead of ICE, and the problem has been discussed on PR 96479.
> >
> > I attached the patch to solve the problem. Bootstrapped and tested on aarch64-linux-gnu. Any suggestions?
>
> Thanks, pushed.  I was initially sceptical because raising an error here and in aarch64_layout_arg is a hack.  Both functions are just query functions and shouldn't have any side effects.
>
> The approach we took for FP modes seemed better: we define the FP move patterns unconditionally, and raise an error if we try to emit an FP move with !TARGET_FLOAT.  This defers any error reporting until we actually try to generate code that depends on TARGET_FLOAT.
>
> But I guess SIMD stuff is different.  There's no reason in principle why you can't use:
>
>   unsigned short __attribute__((vector_size(8)))
>
> *within* a function with -mgeneral-regs-only.  It would just need to be emulated, in the same way as for:
>
>   unsigned short __attribute__((vector_size(4)))
>
> So it would be wrong to define the SIMD move patterns unconditionally and raise an error there.
>
> So all in all, I agree this is the best we can do given the current infrastructure.
>

Since this patch was committed my buildbot is broken for
aarch64-linux-gnu because it now fails to build glibc-2.29:
../stdlib/bits/stdlib-float.h: In function 'atof':
../stdlib/bits/stdlib-float.h:26:1: error: '-mgeneral-regs-only' is
incompatible with the use of floating-point types

I haven't yet tried a more recent glibc version, not sure if 2.29 is
considered obsolete?

Christophe

> Thanks,
> Richard
>


More information about the Gcc-patches mailing list