From patchwork Thu Aug 9 07:08:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Krebbel X-Patchwork-Id: 955385 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-483440-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="tN58ffbm"; 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 41mK9q1NmQz9s1x for ; Thu, 9 Aug 2018 17:09:01 +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:subject:mime-version:content-type:message-id; q=dns; s= default; b=yisH5LQ1bM+ZuOfAwwP0xkw2dOBr22XFb1j6BFCX5YtorvlrQDUDl aj/ZfwNVriCt0ohy6gVGFK0y3qIzJRSLhXfIwJKtuhFxtaSObwhgWZxDYJvmyWWP V65V+l7Z0egMpu+Zci+nDrY7Da8C4pOnczRhujRRxiLkmWhJCxuGQg= 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:subject:mime-version:content-type:message-id; s= default; bh=ODpUUPgumsv1qqwhKzMjoXK0lNM=; b=tN58ffbmRWdsPZ3khmj8 mgVjdoPOl8WPYlZdGDWdU7ABBXrlfSGb/ictXuuZHZUNxMPnRaPRNRvhsul56o6V tVZN7uG8uUQXb1H6acesM+O/PGMnl8wx718VD3nMnqSt+NUs3sDl59z1hHgchBbG UnMcI/6S2lsZHhfYwZ8s6jo= Received: (qmail 100372 invoked by alias); 9 Aug 2018 07:08:54 -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 100359 invoked by uid 89); 9 Aug 2018 07:08:53 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=oldest, Our X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 09 Aug 2018 07:08:51 +0000 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w7974BWO064898 for ; Thu, 9 Aug 2018 03:08:49 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2krdc977af-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 09 Aug 2018 03:08:49 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 9 Aug 2018 08:08:48 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 9 Aug 2018 08:08:45 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w7978iiv41812162 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 9 Aug 2018 07:08:44 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E996E52057 for ; Thu, 9 Aug 2018 10:08:50 +0100 (BST) Received: from bart (unknown [9.152.222.136]) by d06av21.portsmouth.uk.ibm.com (Postfix) with SMTP id DE20652050 for ; Thu, 9 Aug 2018 10:08:49 +0100 (BST) Received: by bart (sSMTP sendmail emulation); Thu, 09 Aug 2018 09:08:42 +0200 Date: Thu, 9 Aug 2018 09:08:42 +0200 From: Andreas Krebbel To: gcc-patches@gcc.gnu.org Subject: [Committed] S/390: Fix PR84332 ICE with stack clash protection MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) x-cbid: 18080907-0016-0000-0000-000001F44171 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18080907-0017-0000-0000-0000324A52EF Message-Id: <20180809070842.GA8437@maggie> X-IsSubscribed: yes Our implementation of the stack probe requires the probe interval to be used as displacement in an address operand. The maximum probe interval currently is 64k. This would exceed short displacements. Trim that value down to 4k if that happens. This might result in too many probes being generated only on the oldest supported machine level z900. Bootstrapped and regression tested on s390x with z900 and z13 defaults. gcc/ChangeLog: 2018-08-09 Andreas Krebbel PR target/84332 * config/s390/s390.c (s390_option_override_internal): Reduce the stack-clash-protection-probe-interval param if it would be too big for z900. gcc/testsuite/ChangeLog: 2018-08-09 Andreas Krebbel PR target/84332 * gcc.target/s390/pr84332.c: New testcase. diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index d533a3fcb4e..d5511d01192 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -14983,6 +14983,17 @@ s390_option_override_internal (struct gcc_options *opts, else if (opts->x_s390_stack_guard) error ("-mstack-guard implies use of -mstack-size"); + /* Our implementation of the stack probe requires the probe interval + to be used as displacement in an address operand. The maximum + probe interval currently is 64k. This would exceed short + displacements. Trim that value down to 4k if that happens. This + might result in too many probes being generated only on the + oldest supported machine level z900. */ + if (!DISP_IN_RANGE ((1 << PARAM_VALUE (PARAM_STACK_CLASH_PROTECTION_PROBE_INTERVAL)))) + set_param_value ("stack-clash-protection-probe-interval", 12, + opts->x_param_values, + opts_set->x_param_values); + #ifdef TARGET_DEFAULT_LONG_DOUBLE_128 if (!TARGET_LONG_DOUBLE_128_P (opts_set->x_target_flags)) opts->x_target_flags |= MASK_LONG_DOUBLE_128; diff --git a/gcc/testsuite/gcc.target/s390/pr84332.c b/gcc/testsuite/gcc.target/s390/pr84332.c new file mode 100644 index 00000000000..3dec99f62c7 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/pr84332.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-march=z900 -fstack-clash-protection --param stack-clash-protection-probe-interval=16" } */ + +struct b +{ + char a[65536]; +}; + +void c (void) { struct b d; }