From patchwork Mon Feb 5 18:28:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 869444 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-472618-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="B32/s5f/"; 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 3zZx1f3ZgBz9t20 for ; Tue, 6 Feb 2018 05:28:51 +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:to:cc :from:subject:date:mime-version:content-type :content-transfer-encoding:message-id; q=dns; s=default; b=ifrZX UUmcsXhk7h64hd66CDBxxPKUA/CF/86lKQFuFAM/o9Ycep8Vl3EqloHYw5gSl5Y+ FH82obIwO1rMxS9OxBEt3bT+TVvHE1E8OEecxqI728uEG9lb37hEN7f0E5KqBNxC Z4zYiHRv2u+EafMk8rOicC+w2WdsKJo5xah9dk= 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:to:cc :from:subject:date:mime-version:content-type :content-transfer-encoding:message-id; s=default; bh=4PZm6zVaKP6 O9yHqbq/kGy5iYpQ=; b=B32/s5f/IEuUJWRhsKgU5aoHWrcu2/g/1eAfaO2sbw+ qGDAThX0AwERXb+znN4LLWXh12Dy/fwQNeBlCecE0nen9rUnr+8W0ZwZ+N67Lnr6 ffH5Zk7JXbFvei12FgiYSrZPAmFV+6X2xr5M4dmCKJEp1eOrRICchu4vJ5rlA+YY = Received: (qmail 68619 invoked by alias); 5 Feb 2018 18:28:44 -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 68600 invoked by uid 89); 5 Feb 2018 18:28:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=emergency, partner 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; Mon, 05 Feb 2018 18:28:41 +0000 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w15IPAfM114841 for ; Mon, 5 Feb 2018 13:28:39 -0500 Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.151]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fxrpp376a-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 05 Feb 2018 13:28:38 -0500 Received: from localhost by e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 5 Feb 2018 11:28:38 -0700 Received: from b03cxnp08025.gho.boulder.ibm.com (9.17.130.17) by e33.co.us.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 5 Feb 2018 11:28:35 -0700 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w15ISYXp4915520; Mon, 5 Feb 2018 11:28:34 -0700 Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ABDCB6E035; Mon, 5 Feb 2018 11:28:34 -0700 (MST) Received: from bigmac.rchland.ibm.com (unknown [9.10.86.134]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP id 6C4DD6E038; Mon, 5 Feb 2018 11:28:34 -0700 (MST) To: GCC Patches Cc: Segher Boessenkool , David Edelsohn From: Bill Schmidt Subject: [PATCH, rs6000] Deprecate -mno-speculate-indirect-jumps Date: Mon, 5 Feb 2018 12:28:34 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18020518-0008-0000-0000-00000945E6BF X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008478; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000248; SDB=6.00985390; UDB=6.00499984; IPR=6.00764760; BA=6.00005812; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00019382; XFM=3.00000015; UTC=2018-02-05 18:28:36 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18020518-0009-0000-0000-000045DAC0CF Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-02-05_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1802050232 X-IsSubscribed: yes Hi, It's been determined that we won't recommend use of the recently added undocumented option -mno-speculate-indirect-jumps. This patch provides a warning indicating that the option is deprecated. We will leave the code in place for potential emergency use (not expected), and plan to remove it completely in GCC 9. Bootstrapped and tested on powerpc64le-linux-gnu with no regressions. Is this okay for trunk? At least one distribution partner has also requested that we backport this to the GCC 7 branch for 7.4. Is that okay as well? Thanks, Bill [gcc] 2018-02-05 Bill Schmidt * config/rs6000/rs6000.c (rs6000_option_override_internal): Display warning message for -mno-speculate-indirect-jumps. [gcc/testsuite] 2018-02-05 Bill Schmidt * gcc.target/powerpc/safe-indirect-jump-1.c: Detect deprecation warning for -mno-speculate-indirect-jumps. * gcc.target/powerpc/safe-indirect-jump-2.c: Likewise. * gcc.target/powerpc/safe-indirect-jump-3.c: Likewise. * gcc.target/powerpc/safe-indirect-jump-4.c: Likewise. * gcc.target/powerpc/safe-indirect-jump-5.c: Likewise. * gcc.target/powerpc/safe-indirect-jump-6.c: Likewise. * gcc.target/powerpc/safe-indirect-jump-7.c: Likewise. Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c (revision 257367) +++ gcc/config/rs6000/rs6000.c (working copy) @@ -5295,6 +5295,11 @@ rs6000_option_override_internal (bool global_init_ if (TARGET_LINK_STACK == -1) SET_TARGET_LINK_STACK (rs6000_tune == PROCESSOR_PPC476 && flag_pic); + /* Deprecate use of -mno-speculate-indirect-jumps. */ + if (!rs6000_speculate_indirect_jumps) + warning (0, "%qs is deprecated and not recommended in any circumstances", + "-mno-speculate-indirect-jumps"); + return ret; } Index: gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-1.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-1.c (revision 257367) +++ gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-1.c (working copy) @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-additional-options "-mno-speculate-indirect-jumps" } */ +/* { dg-warning "'-mno-speculate-indirect-jumps' is deprecated" "" { target *-*-* } 0 } */ /* Test for deliberate misprediction of indirect calls. */ Index: gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-2.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-2.c (revision 257367) +++ gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-2.c (working copy) @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-mno-speculate-indirect-jumps" } */ +/* { dg-warning "'-mno-speculate-indirect-jumps' is deprecated" "" { target *-*-* } 0 } */ /* Test for deliberate misprediction of computed goto. */ Index: gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-3.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-3.c (revision 257367) +++ gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-3.c (working copy) @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-mno-speculate-indirect-jumps" } */ +/* { dg-warning "'-mno-speculate-indirect-jumps' is deprecated" "" { target *-*-* } 0 } */ /* Test for deliberate misprediction of jump tables. */ Index: gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-4.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-4.c (revision 257367) +++ gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-4.c (working copy) @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-additional-options "-mno-speculate-indirect-jumps" } */ +/* { dg-warning "'-mno-speculate-indirect-jumps' is deprecated" "" { target *-*-* } 0 } */ /* Test for deliberate misprediction of indirect calls for ELFv2. */ Index: gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-5.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-5.c (revision 257367) +++ gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-5.c (working copy) @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-additional-options "-mno-speculate-indirect-jumps -Wno-pedantic" } */ +/* { dg-warning "'-mno-speculate-indirect-jumps' is deprecated" "" { target *-*-* } 0 } */ /* Test for deliberate misprediction of computed goto. */ Index: gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-6.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-6.c (revision 257367) +++ gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-6.c (working copy) @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-additional-options "-mno-speculate-indirect-jumps" } */ +/* { dg-warning "'-mno-speculate-indirect-jumps' is deprecated" "" { target *-*-* } 0 } */ /* Test for deliberate misprediction of jump tables. */ Index: gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-7.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-7.c (revision 257367) +++ gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-7.c (working copy) @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-additional-options "-mno-speculate-indirect-jumps" } */ +/* { dg-warning "'-mno-speculate-indirect-jumps' is deprecated" "" { target *-*-* } 0 } */ /* Test for deliberate misprediction of indirect calls. */