From patchwork Wed May 24 11:38:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Krebbel X-Patchwork-Id: 766443 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3wXr4X4fLMz9sDB for ; Wed, 24 May 2017 21:38:20 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="aAd1P9Rn"; dkim-atps=neutral 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=EuYqzajBV5a0cAb 5C1c7i8U5OIRAdnv4tgYMtv/fcMKl2FuPRk+bcuuKSEK+XaDk13Gmb1yzSlZoOI/ kfWQLOwILrxzrSjgw10llkJxrHmnSTbf1YmJ4k6D4uHh34MvK3OMbewrSrBa/XIU IfWiYBvvXYr3IwPE6VWn+ZhY+zPU= 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=Z/jHaN328PWMaq9vwh8qx wVZsGY=; b=aAd1P9RnE/03vxIZvDye5qxBB+8Y2TSYqNG+VMAsA0ohhlY8LTjem V2HcINHeZo+XEllurPnNFUB2BTw4gTvLiYktMQn3gQM0r7xQjjdKPNbyDSInH3Gr vNOc/5QWyAZFVKKTmBlipTQEZAAwI5Nro5bCwlSzxrm1uWiq6IoEvU= Received: (qmail 94096 invoked by alias); 24 May 2017 11:38:06 -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 94042 invoked by uid 89); 24 May 2017 11:38:06 -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, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=Applied, Hx-languages-length:2524, agen 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; Wed, 24 May 2017 11:38:04 +0000 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v4OBYdlh120175 for ; Wed, 24 May 2017 07:38:06 -0400 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 2an2gfawf4-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 24 May 2017 07:38:05 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 24 May 2017 12:38:03 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 24 May 2017 12:38:02 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v4OBc2a420906312 for ; Wed, 24 May 2017 11:38:02 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F3983AE056 for ; Wed, 24 May 2017 12:35:59 +0100 (BST) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D9E8CAE051 for ; Wed, 24 May 2017 12:35:59 +0100 (BST) Received: from maggie.boeblingen.de.ibm.com (unknown [9.152.212.134]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTPS for ; Wed, 24 May 2017 12:35:59 +0100 (BST) From: Andreas Krebbel To: gcc-patches@gcc.gnu.org Subject: [Committed] S/390: Fix PR80725. Date: Wed, 24 May 2017 13:38:01 +0200 X-TM-AS-GCONF: 00 x-cbid: 17052411-0016-0000-0000-000004A92A7F X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17052411-0017-0000-0000-000027CB9FA3 Message-Id: <20170524113801.5294-1-krebbel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-05-24_08:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1705240056 X-IsSubscribed: yes No regressions on s390x. Applied to mainline. Ok for GCC 7 branch as well? Bye, -Andreas- gcc/ChangeLog: 2017-05-24 Andreas Krebbel PR target/80725 * config/s390/s390.c (s390_check_qrst_address): Check incoming address against address_operand predicate. * config/s390/s390.md ("*indirect_jump"): Swap alternatives. gcc/testsuite/ChangeLog: 2017-05-24 Andreas Krebbel * gcc.target/s390/pr80725.c: New test. --- gcc/config/s390/s390.c | 3 +++ gcc/config/s390/s390.md | 10 ++++++---- gcc/testsuite/gcc.target/s390/pr80725.c | 26 ++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/gcc.target/s390/pr80725.c diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index c16391a..7be22d9 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -3102,6 +3102,9 @@ s390_check_qrst_address (char c, rtx op, bool lit_pool_ok) struct s390_address addr; bool decomposed = false; + if (!address_operand (op, GET_MODE (op))) + return 0; + /* This check makes sure that no symbolic address (except literal pool references) are accepted by the R or T constraints. */ if (s390_loadrelative_operand_p (op, NULL, NULL)) diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index c9fd19a..cfae171 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -9660,14 +9660,16 @@ operands[0] = force_reg (Pmode, operands[0]); }) +; The first constraint must be an "extra address constraint" in order +; to trigger address reloading in LRA/reload (define_insn "*indirect_jump" [(set (pc) - (match_operand 0 "address_operand" "a,ZR"))] + (match_operand 0 "address_operand" "ZR,a"))] "" "@ - br\t%0 - b\t%a0" - [(set_attr "op_type" "RR,RX") + b\t%a0 + br\t%0" + [(set_attr "op_type" "RX,RR") (set_attr "type" "branch") (set_attr "atype" "agen") (set_attr "cpu_facility" "*")]) diff --git a/gcc/testsuite/gcc.target/s390/pr80725.c b/gcc/testsuite/gcc.target/s390/pr80725.c new file mode 100644 index 0000000..4a402c4 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/pr80725.c @@ -0,0 +1,26 @@ +/* Regression test for PR/80725. */ + +/* { dg-do compile } */ +/* { dg-options "-O2 -march=zEC12" } */ + +int a, e; +const char b; +char c; +const int d; +void bar (short); + +void +foo (int x, int y) +{ + long f = d; + short g = 0; + while (e) + while (a < x) + { + if (y) + goto *d; + g = b | b + g; + bar (g); + c = (char) (long) foo; + } +}