From patchwork Sat Dec 21 00:29:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Meissner X-Patchwork-Id: 1214390 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-516425-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="uubrzjw4"; 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 47fmhs2x3Vz9sPV for ; Sat, 21 Dec 2019 11:29:46 +1100 (AEDT) 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:message-id:references:mime-version:content-type :in-reply-to; q=dns; s=default; b=PFlm/lWa1s5RH3+9WYtWVQPT6m3+N0 VhZMY9Zl+7z+AQkv+6dCGnRvdGKglFpRSzMquRHmLdP2Q98MZXQXuyfi8sJzKPdR VjxRy+qmGbaNrrMXybLuQP0igD/KCeAq6WiScMhYexTNxfDuCnqM1Vjkfsa8gGLW nr6IRwKosDAIQ= 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:message-id:references:mime-version:content-type :in-reply-to; s=default; bh=309IfS1Y+3U7iitKiU8SPVGjwaE=; b=uubr zjw4N9/QfwxwfDZ5JZcgeJgz6q87UzskD8aY+sNtOygdXtThrLLKEcVY0ehSqm2K SovTdrydsFBsNhBpD1DaL91TUQCIqrrumZUiO8ej/xf/s5WfX2GoU+/T13lS4OkT hlohVqaiOIbvEjtDd2DBEx3Ni4iFaw41QlOds+Y= Received: (qmail 96921 invoked by alias); 21 Dec 2019 00:29:37 -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 96910 invoked by uid 89); 21 Dec 2019 00:29:36 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=UD:prefix-stack-protect.c X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 21 Dec 2019 00:29:35 +0000 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xBL0Rrvf054558; Fri, 20 Dec 2019 19:29:34 -0500 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2x0xcdaanf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Dec 2019 19:29:34 -0500 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id xBL0SQA2056058; Fri, 20 Dec 2019 19:29:33 -0500 Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com with ESMTP id 2x0xcdaan9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Dec 2019 19:29:33 -0500 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id xBL0OMnF028278; Sat, 21 Dec 2019 00:29:32 GMT Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by ppma01dal.us.ibm.com with ESMTP id 2wvqc7tn9t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 21 Dec 2019 00:29:32 +0000 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xBL0TVG628967402 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 21 Dec 2019 00:29:32 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E185BB2066; Sat, 21 Dec 2019 00:29:31 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B8313B205F; Sat, 21 Dec 2019 00:29:31 +0000 (GMT) Received: from ibm-toto.the-meissners.org (unknown [9.32.77.177]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTPS; Sat, 21 Dec 2019 00:29:31 +0000 (GMT) Date: Fri, 20 Dec 2019 19:29:30 -0500 From: Michael Meissner To: Michael Meissner , gcc-patches@gcc.gnu.org, Segher Boessenkool , David Edelsohn Subject: [PATCH] V11 patch #13 of 15, Add test for -mcpu=future -fstack-protect-strong with large stacks Message-ID: <20191221002930.GM28993@ibm-toto.the-meissners.org> Mail-Followup-To: Michael Meissner , gcc-patches@gcc.gnu.org, Segher Boessenkool , David Edelsohn References: <20191220231507.GA18386@ibm-toto.the-meissners.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191220231507.GA18386@ibm-toto.the-meissners.org> User-Agent: Mutt/1.5.21 (2010-09-15) This is patch V8 #6. It makes sure the stack protect insns work when -mcpu=future and -fstack-protector-strong are used together. We discovered this failure when we attempted to build GLIBC using -mcpu=future. https://gcc.gnu.org/ml/gcc-patches/2019-12/msg00089.html This test now passes when I run it as part of the test suite, can I check it in to the trunk? 2019-12-20 Michael Meissner * gcc.target/powerpc/prefix-stack-protect.c: New test to make sure -fstack-protect-strong works with prefixed addressing. Index: gcc/testsuite/gcc.target/powerpc/prefix-stack-protect.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/prefix-stack-protect.c (revision 279324) +++ gcc/testsuite/gcc.target/powerpc/prefix-stack-protect.c (working copy) @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_prefixed_addr } */ +/* { dg-options "-O2 -mdejagnu-cpu=future -fstack-protector-strong" } */ + +/* Test that we can handle large stack frames with -fstack-protector-strong and + prefixed addressing. This was originally discovered in trying to build + glibc with -mcpu=future, and vfwprintf.c failed because it used + -fstack-protector-strong. */ + +extern long foo (char *); + +long +bar (void) +{ + char buffer[0x20000]; + return foo (buffer) + 1; +} + +/* { dg-final { scan-assembler {\mpld\M} } } */ +/* { dg-final { scan-assembler {\mpstd\M} } } */