This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][GCC][AArch64] Have empty HWCAPs string ignored during native feature detection
- From: Christophe Lyon <christophe dot lyon at linaro dot org>
- To: Tamar Christina <Tamar dot Christina at arm dot com>
- Cc: James Greenhalgh <James dot Greenhalgh at arm dot com>, Jakub Jelinek <jakub at redhat dot com>, Kyrill Tkachov <kyrylo dot tkachov at foss dot arm dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, nd <nd at arm dot com>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>, Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>
- Date: Mon, 4 Mar 2019 14:31:57 +0100
- Subject: Re: [PATCH][GCC][AArch64] Have empty HWCAPs string ignored during native feature detection
- References: <20181218133602.GA19324@arm.com> <5C37798B.4000404@foss.arm.com> <20190123162740.GI30353@tucnak> <DB6PR0802MB23092D8C8F6097E4F0934183FF900@DB6PR0802MB2309.eurprd08.prod.outlook.com> <20190130141112.GU2135@tucnak> <DB6PR0802MB23098C2D6853D8EC9550EB81FF900@DB6PR0802MB2309.eurprd08.prod.outlook.com> <DB6PR0802MB23099CBF38203923250E28A2FF680@DB6PR0802MB2309.eurprd08.prod.outlook.com> <20190227172203.GB20741@arm.com> <DB6PR0802MB2309FA1AC0027BF53DE9BA30FF740@DB6PR0802MB2309.eurprd08.prod.outlook.com>
On Wed, 27 Feb 2019 at 18:32, Tamar Christina <Tamar.Christina@arm.com> wrote:
>
> Hi James,
>
> > -----Original Message-----
> > From: James Greenhalgh <james.greenhalgh@arm.com>
> > Sent: Wednesday, February 27, 2019 17:22
> > To: Tamar Christina <Tamar.Christina@arm.com>
> > Cc: Jakub Jelinek <jakub@redhat.com>; Kyrill Tkachov
> > <kyrylo.tkachov@foss.arm.com>; gcc-patches@gcc.gnu.org; nd
> > <nd@arm.com>; Richard Earnshaw <Richard.Earnshaw@arm.com>; Marcus
> > Shawcroft <Marcus.Shawcroft@arm.com>
> > Subject: Re: [PATCH][GCC][AArch64] Have empty HWCAPs string ignored
> > during native feature detection
> >
> > On Thu, Feb 07, 2019 at 04:43:24AM -0600, Tamar Christina wrote:
> > > Hi All,
> > >
> > > Since this hasn't been reviewed yet anyway I've updated this patch to also
> > fix the memory leaks etc.
> > >
> > > --
> > >
> > > This patch makes the feature detection code for AArch64 GCC not add
> > > features automatically when the feature had no hwcaps string to match
> > against.
> > >
> > > This means that -mcpu=native no longer adds feature flags such as +profile.
> > > The behavior wasn't noticed before because at the time +profile was
> > > added a bug was preventing any feature bits from being added by native
> > detections.
> > >
> > > The loop has also been changed as Jakub specified in order to avoid a
> > > memory leak that was present in the existing code and to be slightly more
> > efficient.
> > >
> > > Bootstrapped Regtested on aarch64-none-linux-gnu and no issues.
> > >
> > > Ok for trunk?
> >
> > OK. Is this also desirable for a backport?
>
> Yes I believe we have this problem in GCC8 as well the profile extensions.
>
> Kind regards,
> Tamar
>
Hi Tamar,
The new test fails with a cross-compiler, because:
FAIL: gcc.target/aarch64/options_set_10.c (test for excess errors)
Excess errors:
cc1: error: unknown value 'native' for -mcpu
I don't know how to restrict tests to native compilers only.
Christophe
> >
> > Thanks,
> > James
> >
> > >
> > > Thanks,
> > > Tamar
> > >
> > > gcc/ChangeLog:
> > >
> > > 2019-02-07 Tamar Christina <tamar.christina@arm.com>
> > >
> > > PR target/88530
> > > * config/aarch64/aarch64-option-extensions.def: Document it.
> > > * config/aarch64/driver-aarch64.c (host_detect_local_cpu): Skip
> > feature
> > > if empty hwcaps.
> > >
> > > gcc/testsuite/ChangeLog:
> > >
> > > 2019-02-07 Tamar Christina <tamar.christina@arm.com>
> > >
> > > PR target/88530
> > > * gcc.target/aarch64/options_set_10.c: New test.
> > >