From patchwork Fri Feb 9 11:48:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Krebbel X-Patchwork-Id: 871345 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-472937-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="wzZbZsni"; 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 3zdCy80wKqz9s72 for ; Fri, 9 Feb 2018 22:48:47 +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:from :to:subject:date:message-id; q=dns; s=default; b=eX8ikW6z/sWOdb0 ZEnALBJY25eX7QpeNeq9cmiC8LjkQOR0p6t3iTcTeFsrPVitFpD8gztd4ka4bTKE 6hT2rsJ0IKKsWlP7F9+Yw4aig8wzDFYeW7uIf3gK9NteGO1w3Wn2ivGE+OwA6xYv 0A0QzOwbhoRb62yZSKYsjV19K5WM= 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:from :to:subject:date:message-id; s=default; bh=Jl5cQ8p4gwh7cFEJFTr7X YFm1v4=; b=wzZbZsnigg1wFf6shuiJpBuQoMnBei67Al5AYBK0BHRKM0GnPFyug sp8dvWr1RyFEO06s9s6jZc2148JKZM/Fxb+nLKhmnzl7q1drIMQ6FeoY6xYOOUbB cApgTY50Yndp+IqJXlS2Km7kAFOHElNp1SnuqVX3Qu/sP+QTk9hKTs= Received: (qmail 30627 invoked by alias); 9 Feb 2018 11:48:39 -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 30528 invoked by uid 89); 9 Feb 2018 11:48:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy= 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; Fri, 09 Feb 2018 11:48:33 +0000 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w19BmVSF088577 for ; Fri, 9 Feb 2018 06:48:31 -0500 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0a-001b2d01.pphosted.com with ESMTP id 2g16cy5226-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 09 Feb 2018 06:48:30 -0500 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 9 Feb 2018 11:48:28 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 9 Feb 2018 11:48:25 -0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w19BmP4944695560 for ; Fri, 9 Feb 2018 11:48:25 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 29AA34C040 for ; Fri, 9 Feb 2018 11:42:14 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0F1C04C046 for ; Fri, 9 Feb 2018 11:42:14 +0000 (GMT) Received: from maggie.boeblingen.de.ibm.com (unknown [9.152.212.134]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTPS for ; Fri, 9 Feb 2018 11:42:13 +0000 (GMT) From: Andreas Krebbel To: gcc-patches@gcc.gnu.org Subject: [Committed] S/390: Fix PR84295 Date: Fri, 9 Feb 2018 12:48:24 +0100 X-TM-AS-GCONF: 00 x-cbid: 18020911-0012-0000-0000-000005AD1A06 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18020911-0013-0000-0000-00001928D834 Message-Id: <20180209114824.12786-1-krebbel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-02-09_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 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-1802090150 X-IsSubscribed: yes Bootstrapped and regression tested with --with-arch=z14 and --with-arch=z900. Glibc build is clean with that patch using -mindirect-branch=thunk and -mfunction-return=thunk. gcc/ChangeLog: 2018-02-09 Andreas Krebbel PR target/PR84295 * config/s390/s390.c (s390_set_current_function): Invoke s390_indirect_branch_settings also if fndecl didn't change. gcc/testsuite/ChangeLog: 2018-02-09 Andreas Krebbel PR target/PR84295 * gcc.target/s390/pr84295.c: New test. --- gcc/config/s390/s390.c | 5 ++++- gcc/testsuite/gcc.target/s390/pr84295.c | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/s390/pr84295.c diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 62a60e2..298fdd1 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -16135,7 +16135,10 @@ s390_set_current_function (tree fndecl) several times in the course of compiling a function, and we don't want to slow things down too much or call target_reinit when it isn't safe. */ if (fndecl == s390_previous_fndecl) - return; + { + s390_indirect_branch_settings (fndecl); + return; + } tree old_tree; if (s390_previous_fndecl == NULL_TREE) diff --git a/gcc/testsuite/gcc.target/s390/pr84295.c b/gcc/testsuite/gcc.target/s390/pr84295.c new file mode 100644 index 0000000..4da43c3 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/pr84295.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z900 -fgnu89-inline --save-temps -mfunction-return-reg=thunk -mindirect-branch-table" } */ + +extern void foo (void); +extern __inline void foo (void) {} +void foo (void) {} + +/* { dg-final { scan-assembler-times "jg\t__s390_indirect_jump" 1 } } */ +/* { dg-final { scan-assembler "ex\t" } } */ + +/* { dg-final { scan-assembler-not "section\t.s390_indirect_jump" } } */ +/* { dg-final { scan-assembler-not "section\t.s390_indirect_call" } } */ +/* { dg-final { scan-assembler "section\t.s390_return_reg" } } */ +/* { dg-final { scan-assembler-not "section\t.s390_return_mem" } } */