From patchwork Wed Jul 11 11:23:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamar Christina X-Patchwork-Id: 942449 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-481346-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="i3aYZQaC"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.b="ME71y1Dr"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41QcBn4dVwz9s01 for ; Wed, 11 Jul 2018 21:23:29 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=JCncQ8QbeTpz+z6XMm3LV+nSUOCKrFzqzJY18OvXG2nyDF0BMW U44D57DhbadlsR8SoEkpVRCWBq5CfeY8Yrb9rjxgQ9D8MPiVByi1TVl+2R5A0D0c 6N7jTMF+IIjzR/zJhTvhgXWi5EeN0h7+TX+CpgNXXzCi5EEt/VpSGG9u0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=mHPhzHcysTi/1LnjJZ8Y7p9GMac=; b=i3aYZQaC+f7FpYLcxKsY dDluN1lF1JOEn6sc+67Z6dvbrxUOmFRiRwyLRh+Deegr7b9vPHNIVkH3Rk+fGk3F gFZIECSBCWL58C8pINzdjUyc4tLZhiYb5jBbHyWUzgh0Ygub5C+jXkumzS1XusPJ FjeZT01tSdBYiKB9fjQuGXM= Received: (qmail 85785 invoked by alias); 11 Jul 2018 11:23:22 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 85719 invoked by uid 89); 11 Jul 2018 11:23:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: EUR01-VE1-obe.outbound.protection.outlook.com Received: from mail-ve1eur01on0059.outbound.protection.outlook.com (HELO EUR01-VE1-obe.outbound.protection.outlook.com) (104.47.1.59) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 11 Jul 2018 11:23:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jRvgB6eb1VXvDNV2cY+b5U/GpG88VgPr+mtMeg43tX8=; b=ME71y1Drji7oLIuy4Ki0sPpPMS5LP1mbnwXEmWsFJJeWXRYIor4N2urs+iuA56ONM2wm+RbHS9YNM/v/b4wAMjjAHX0rGxqtZ1m1Yi0jXdsu00F6mBfRr/OHBUlbPSR2/hSgIH413OB9kxp4B6Igo7ArjokrQNleWfqZIOZ+E/k= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Tamar.Christina@arm.com; Received: from arm.com (217.140.96.140) by DB5PR08MB0741.eurprd08.prod.outlook.com (2a01:111:e400:599c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.930.21; Wed, 11 Jul 2018 11:23:15 +0000 Date: Wed, 11 Jul 2018 12:23:12 +0100 From: Tamar Christina To: gcc-patches@gcc.gnu.org Cc: nd@arm.com, james.greenhalgh@arm.com, Richard.Earnshaw@arm.com, Marcus.Shawcroft@arm.com Subject: [PATCH][GCC][AArch64] Cleanup the AArch64 testsuite when stack-clash is on [Patch (6/6)] Message-ID: <20180711112310.GA15972@arm.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-IsSubscribed: yes 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 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. diff --git a/gcc/testsuite/c-c++-common/ubsan/vla-1.c b/gcc/testsuite/c-c++-common/ubsan/vla-1.c index 52ade3aab7566dce3ca7ef931ac65895005d5e13..c97465edae195442a71ee66ab25015a2ac4fc8fc 100644 --- a/gcc/testsuite/c-c++-common/ubsan/vla-1.c +++ b/gcc/testsuite/c-c++-common/ubsan/vla-1.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-fsanitize=vla-bound -Wall -Wno-unused-variable" } */ +/* { dg-options "-fsanitize=vla-bound -Wall -Wno-unused-variable -fno-stack-clash-protection" } */ typedef long int V; int x = -1; diff --git a/gcc/testsuite/gcc.dg/params/blocksort-part.c b/gcc/testsuite/gcc.dg/params/blocksort-part.c index a9154f2e61ccd21b60153f20be3891b988f9ef2c..1e677878e7bd9c68b026f8c72b0de9f01e15459c 100644 --- a/gcc/testsuite/gcc.dg/params/blocksort-part.c +++ b/gcc/testsuite/gcc.dg/params/blocksort-part.c @@ -1,3 +1,4 @@ +/* { dg-skip-if "AArch64 does not support these bounds." { aarch64*-*-* } { "--param stack-clash-protection-*" } } */ /*-------------------------------------------------------------*/ /*--- Block sorting machinery ---*/ diff --git a/gcc/testsuite/gcc.dg/pr82788.c b/gcc/testsuite/gcc.dg/pr82788.c index a8f628fd7f66c3e56739f6ff491df38b23f4d4df..41c442f61a625c8b350e1e4c870a98d86b167031 100644 --- a/gcc/testsuite/gcc.dg/pr82788.c +++ b/gcc/testsuite/gcc.dg/pr82788.c @@ -1,4 +1,5 @@ /* { dg-do run } */ /* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-probe-interval=10 --param stack-clash-protection-guard-size=12" } */ /* { dg-require-effective-target supports_stack_clash_protection } */ +/* { dg-skip-if "AArch64 does not support this interval." { aarch64*-*-* } } */ int main() { int a[1442]; return 0;} diff --git a/gcc/testsuite/gcc.target/aarch64/subsp.c b/gcc/testsuite/gcc.target/aarch64/subsp.c index 70d848c59d1f1e4df4314ca012c7a5d9d3b91ebc..6ef6b2c90ae694055749a94b68cbba5ee4aea882 100644 --- a/gcc/testsuite/gcc.target/aarch64/subsp.c +++ b/gcc/testsuite/gcc.target/aarch64/subsp.c @@ -1,4 +1,4 @@ -/* { dg-options "-O" } */ +/* { dg-options "-O -fno-stack-clash-protection" } */ int foo (void *); diff --git a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_3.c b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_3.c index 29702ab55f249c3ebd0baf44981870524098e1e4..baeec61bb59aff56f0dcc20fc6ec6b93d517490e 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_3.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_load_3.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-vectorize -ffast-math" } */ +/* { dg-options "-O2 -ftree-vectorize -ffast-math -fno-stack-clash-protection" } */ #include diff --git a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_store_3.c b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_store_3.c index 001f5be8ff58bfcc75eccc4c050bef1e53faffeb..eae3be7a7b24dc124f7c1c26a97fb25400cc62d2 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_store_3.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_store_3.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-vectorize -ffast-math" } */ +/* { dg-options "-O2 -ftree-vectorize -ffast-math -fno-stack-clash-protection" } */ #include diff --git a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_store_4.c b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_store_4.c index 59e9ee49c4a214b731ed1975da0dcfa46c059f8b..ce9825f73e8495a7f5c1f4ab1d5bf1aaf5035e17 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_store_4.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/mask_struct_store_4.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-vectorize -ffast-math" } */ +/* { dg-options "-O2 -ftree-vectorize -ffast-math -fno-stack-clash-protection" } */ #include