From patchwork Tue Nov 8 14:38:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dominik Vogt X-Patchwork-Id: 692335 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 3tCsQB6Rr0z9t3N for ; Wed, 9 Nov 2016 01:39:14 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="PyXKKduV"; 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:date :from:to:cc:subject:reply-to:mime-version:content-type :message-id; q=dns; s=default; b=VomJSxiyMCmOBsd8rNK+r29CjZux3fO bwBRYvlp4PW+und26tjA9k2wi0WMNo4/Kt6+QTeVSXkyoLAvsG94AU1b9tMNtqUv muAw7Yqasja1Be+e/J6bneOpzU7kLBP+nkdaNlflmm+wUwOuyNWcK5DGfvtgcFUo D3PBMN0A2CF0= 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:cc:subject:reply-to:mime-version:content-type :message-id; s=default; bh=ttOXn4oApT7DtmXp9kmtUncq1uc=; b=PyXKK duVtGrvdRKu5rhrBzUVrT6cpeKE+k8yktC+9OB/qZoakPTAB13qw9lp/nSYpuxWp OASBX+8FSRbRJTHOlhNqJxLVkn0lTEwbhUCteWFUn6HHsymZAqGB+rkuBHfJO+ny cGwUCMyoBYHkebU4ucwbPHdmSF+tsXMRtefdEg= Received: (qmail 65632 invoked by alias); 8 Nov 2016 14:39:07 -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 65612 invoked by uid 89); 8 Nov 2016 14:39:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, RCVD_IN_SEMBACKSCATTER autolearn=no version=3.3.2 spammy=2128, CC_REGNUM, cc_regnum, ciao 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; Tue, 08 Nov 2016 14:38:56 +0000 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uA8EcomI078016 for ; Tue, 8 Nov 2016 09:38:55 -0500 Received: from e06smtp08.uk.ibm.com (e06smtp08.uk.ibm.com [195.75.94.104]) by mx0a-001b2d01.pphosted.com with ESMTP id 26kf82dvwq-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 08 Nov 2016 09:38:52 -0500 Received: from localhost by e06smtp08.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 8 Nov 2016 14:38:45 -0000 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp08.uk.ibm.com (192.168.101.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 8 Nov 2016 14:38:20 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id A74B9219004D for ; Tue, 8 Nov 2016 14:37:33 +0000 (GMT) Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id uA8EcJJL33620182 for ; Tue, 8 Nov 2016 14:38:19 GMT Received: from d06av01.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id uA8EcJoe004636 for ; Tue, 8 Nov 2016 07:38:19 -0700 Received: from oc5510024614.ibm.com (dyn-9-152-224-33.boeblingen.de.ibm.com [9.152.224.33]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id uA8EcJJW004633; Tue, 8 Nov 2016 07:38:19 -0700 Received: by oc5510024614.ibm.com (Postfix, from userid 500) id EDA6F18F62; Tue, 8 Nov 2016 15:38:18 +0100 (CET) Date: Tue, 8 Nov 2016 15:38:18 +0100 From: Dominik Vogt To: gcc-patches@gcc.gnu.org Cc: Andreas Krebbel Subject: [PATCH] S390: Fix PR/77822. Reply-To: vogt@linux.vnet.ibm.com Mail-Followup-To: vogt@linux.vnet.ibm.com, gcc-patches@gcc.gnu.org, Andreas Krebbel MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-12-10) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16110814-0032-0000-0000-0000023E0073 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16110814-0033-0000-0000-00001DA201CA Message-Id: <20161108143818.GA20524@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-11-08_05:, , 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-1609300000 definitions=main-1611080264 The attached patch fixes PR/77822 on s390/s390x dor gcc-6 *only*. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77822 Bootstrapped and regression tested on s390 and s390x biarch on a zEC12. For gcc-7, there will be a different patch. Ciao Dominik ^_^ ^_^ diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index b3d4370..899ed62 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -3708,6 +3708,10 @@ (clobber (reg:CC CC_REGNUM))])] "TARGET_Z10" { + if (!IN_RANGE (INTVAL (operands[3]), 0, GET_MODE_BITSIZE (DImode) - 1) + || !IN_RANGE (INTVAL (operands[3]) + INTVAL (operands[2]), 1, + GET_MODE_BITSIZE (DImode))) + FAIL; /* Starting with zEC12 there is risbgn not clobbering CC. */ if (TARGET_ZEC12) { @@ -3726,7 +3730,9 @@ (match_operand:GPR 1 "register_operand" "d") (match_operand 2 "const_int_operand" "") ; size (match_operand 3 "const_int_operand" "")))] ; start] - "TARGET_ZEC12" + "TARGET_ZEC12 + && IN_RANGE (INTVAL (operands[3]), 0, GET_MODE_BITSIZE (DImode) - 1) + && IN_RANGE (INTVAL (operands[3]) + INTVAL (operands[2]), 1, GET_MODE_BITSIZE (DImode))" "risbgn\t%0,%1,64-%2,128+63,+%3+%2" ; dst, src, start, end, shift [(set_attr "op_type" "RIE")]) @@ -3737,7 +3743,9 @@ (match_operand 2 "const_int_operand" "") ; size (match_operand 3 "const_int_operand" ""))) ; start (clobber (reg:CC CC_REGNUM))] - "TARGET_Z10" + "TARGET_Z10 + && IN_RANGE (INTVAL (operands[3]), 0, GET_MODE_BITSIZE (DImode) - 1) + && IN_RANGE (INTVAL (operands[3]) + INTVAL (operands[2]), 1, GET_MODE_BITSIZE (DImode))" "risbg\t%0,%1,64-%2,128+63,+%3+%2" ; dst, src, start, end, shift [(set_attr "op_type" "RIE") (set_attr "z10prop" "z10_super_E1")])