This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][GCC][AArch64] Cleanup the AArch64 testsuite when stack-clash is on [Patch (6/6)]
- From: Jeff Law <law at redhat dot com>
- To: tamar dot christina at arm dot com, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: nd <nd at arm dot com>, James Greenhalgh <James dot Greenhalgh at arm dot com>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>, Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>
- Date: Fri, 3 Aug 2018 12:29:52 -0600
- Subject: Re: [PATCH][GCC][AArch64] Cleanup the AArch64 testsuite when stack-clash is on [Patch (6/6)]
- References: <20180711112310.GA15972@arm.com> <20180724102803.GC3249@arm.com>
On 07/24/2018 04:28 AM, tamar.christina@arm.com wrote:
> Hi All,
>
> This patch cleans up the testsuite when a run is done with stack clash
> protection turned on.
>
> Concretely this switches off -fstack-clash-protection for a couple of tests:
>
> * sve: We don't yet support stack-clash-protection and sve, so for now turn these off.
> * assembler scan: some tests are quite fragile in that they check for exact
> assembly output, e.g. check for exact amount of sub etc. These won't
> match now.
> * vla: Some of the ubsan tests negative array indices. Because the arrays weren't
> used before the incorrect $sp wouldn't have been used. The correct value is
> restored on ret. Now however we probe the $sp which causes a segfault.
> * params: When testing the parameters we have to skip these on AArch64 because of our
> custom constraints on them. We already test them separately so this isn't a
> loss.
>
> Note that the testsuite is not entire clean due to gdb failure caused by alloca with
> stack clash. On AArch64 we output an incorrect .loc directive, but this is already the
> case with the current implementation in GCC and is a bug unrelated to this patch series.
>
> Bootstrapped Regtested on aarch64-none-linux-gnu, x86_64-pc-linux-gnu and no issues.
> Both targets were tested with stack clash on and off by default.
>
> Ok for trunk?
>
> Thanks,
> Tamar
>
> gcc/testsuite/
> 2018-07-24 Tamar Christina <tamar.christina@arm.com>
>
> PR target/86486
> * gcc.dg/pr82788.c: Skip for AArch64.
> * gcc.dg/guality/vla-1.c: Turn off stack-clash.
> * gcc.target/aarch64/subsp.c: Likewise.
> * gcc.target/aarch64/sve/mask_struct_load_3.c: Likewise.
> * gcc.target/aarch64/sve/mask_struct_store_3.c: Likewise.
> * gcc.target/aarch64/sve/mask_struct_store_4.c: Likewise.
> * gcc.dg/params/blocksort-part.c: Skip stack-clash checks
> on AArch64.
> * gcc.dg/stack-check-10.c: Add AArch64 specific checks.
> * gcc.dg/stack-check-5.c: Add AArch64 specific checks.
> * gcc.dg/stack-check-6a.c: Skip on AArch64, we don't support this.
> * testsuite/lib/target-supports.exp
> (check_effective_target_frame_pointer_for_non_leaf): AArch64 does not
> require frame pointer for non-leaf functions.
>
>> -----Original Message-----
>> From: Tamar Christina <tamar.christina@arm.com>
>> Sent: Wednesday, July 11, 2018 12:23
>> To: gcc-patches@gcc.gnu.org
>> Cc: nd <nd@arm.com>; James Greenhalgh <James.Greenhalgh@arm.com>;
>> Richard Earnshaw <Richard.Earnshaw@arm.com>; Marcus Shawcroft
>> <Marcus.Shawcroft@arm.com>
>> Subject: [PATCH][GCC][AArch64] Cleanup the AArch64 testsuite when stack-
>> clash is on [Patch (6/6)]
>>
>> Hi All,
>>
>> This patch cleans up the testsuite when a run is done with stack clash
>> protection turned on.
>>
>> Concretely this switches off -fstack-clash-protection for a couple of tests:
>>
>> * sve: We don't yet support stack-clash-protection and sve, so for now turn
>> these off.
>> * assembler scan: some tests are quite fragile in that they check for exact
>> assembly output, e.g. check for exact amount of sub etc. These won't
>> match now.
>> * vla: Some of the ubsan tests negative array indices. Because the arrays
>> weren't
>> used before the incorrect $sp wouldn't have been used. The correct
>> value is
>> restored on ret. Now however we probe the $sp which causes a segfault.
>> * params: When testing the parameters we have to skip these on AArch64
>> because of our
>> custom constraints on them. We already test them separately so this
>> isn't a
>> loss.
>>
>> Note that the testsuite is not entire clean due to gdb failure caused by alloca
>> with stack clash. On AArch64 we output an incorrect .loc directive, but this is
>> already the case with the current implementation in GCC and is a bug
>> unrelated to this patch series.
>>
>> Bootstrapped Regtested on aarch64-none-linux-gnu, x86_64-pc-linux-gnu
>> and no issues.
>> Both targets were tested with stack clash on and off by default.
>>
>> Ok for trunk?
>>
>> Thanks,
>> Tamar
>>
>> gcc/testsuite/
>> 2018-07-11 Tamar Christina <tamar.christina@arm.com>
>>
>> PR target/86486
>> gcc.dg/pr82788.c: Skip for AArch64.
>> gcc.dg/guality/vla-1.c: Turn off stack-clash.
>> gcc.target/aarch64/subsp.c: Likewise.
>> gcc.target/aarch64/sve/mask_struct_load_3.c: Likewise.
>> gcc.target/aarch64/sve/mask_struct_store_3.c: Likewise.
>> gcc.target/aarch64/sve/mask_struct_store_4.c: Likewise.
>> gcc.dg/params/blocksort-part.c: Skip stack-clash checks
>> on AArch64.
This is fine. FWIW, I'd been ignoring vla-1 and one or two others that
were clearly invalid if stack-clash were on by default locally, but
didn't push any kind of patch for that upstream since I didn't think
anyone builds with stack-clash on by default (I did for testing purposes
of course).
Jeff