From patchwork Wed Jul 6 07:06:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Krebbel X-Patchwork-Id: 645144 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 3rksHf1KW5z9sBl for ; Wed, 6 Jul 2016 17:06:36 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=deED+WSG; 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=PWmEc66jpZrl8hi 7YWYVP52xP5bu6yuqMvR0rf5sYzymkXhGhb6Sbt2Ot+bNBRqC9UrtR5GRW6wG/XT I0tJIvL+7g4yg6OCBUVkv7z3P5JBXUKsQxrLMsQJDMKdJTTAgqa/LlPKka3eFCIo U+tcgYo5sC7/Aaah0kiXaQnq0hwc= 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=G6UkwFec2k9lkql+hF3+c 6bb7fY=; b=deED+WSGt1hfgPHrpXKZOOI8TO6GGYDLkzzHysbM/xHfvADHW7mzt mZ+uLhirlm3WrhBbiBSj8r65mhZRPn1yAVvgIEa2YPgBvxLkIPrkwHrqueRt9CFh c5440rE4ivlcuDQml/+tWKvx1DglSvxtO50+tUhW7xL0aoMI2I0iP8= Received: (qmail 111818 invoked by alias); 6 Jul 2016 07:06:28 -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 111801 invoked by uid 89); 6 Jul 2016 07:06:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 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=H*m:linux, sk:wschmid, U*wschmidt, sk:genera X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 06 Jul 2016 07:06:26 +0000 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u6673a00124532 for ; Wed, 6 Jul 2016 03:06:24 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0b-001b2d01.pphosted.com with ESMTP id 240ne4bu85-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 06 Jul 2016 03:06:24 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 6 Jul 2016 08:06:21 +0100 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 6 Jul 2016 08:06:19 +0100 X-IBM-Helo: d06dlp02.portsmouth.uk.ibm.com X-IBM-MailFrom: krebbel@linux.vnet.ibm.com X-IBM-RcptTo: gcc-patches@gcc.gnu.org Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 229162190056 for ; Wed, 6 Jul 2016 08:05:48 +0100 (BST) Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u6676I5b65011818 for ; Wed, 6 Jul 2016 07:06:18 GMT Received: from d06av08.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u6676IQG012494 for ; Wed, 6 Jul 2016 01:06:18 -0600 Received: from maggie.boeblingen.de.ibm.com (dyn-9-152-212-147.boeblingen.de.ibm.com [9.152.212.147]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u6676Ik1012474 (version=TLSv1/SSLv3 cipher=AES256-SHA256 bits=256 verify=NO) for ; Wed, 6 Jul 2016 01:06:18 -0600 From: Andreas Krebbel To: gcc-patches@gcc.gnu.org Subject: [Committed] S/390: Fix vecinit expansion. Date: Wed, 6 Jul 2016 09:06:18 +0200 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16070607-0040-0000-0000-000001F9A3B2 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16070607-0041-0000-0000-000020E55020 Message-Id: <1467788778-7688-1-git-send-email-krebbel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-07-06_03:, , 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-1604210000 definitions=main-1607060064 X-IsSubscribed: yes The fallback routine in the S/390 vecinit expander did not check whether each of the initializer elements is a proper general_operand. Since revision r236582 the expander is invoked also with e.g. symbol refs with an odd addend resulting in invalid insns. Fixed by forcing the element into a register in such cases. gcc/ChangeLog: 2016-07-06 Andreas Krebbel * config/s390/s390.c (s390_expand_vec_init): Force initializer element to register if it doesn't match general_operand. --- gcc/ChangeLog | 5 +++++ gcc/config/s390/s390.c | 16 +++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f309904..b248acd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-07-06 Andreas Krebbel + + * config/s390/s390.c (s390_expand_vec_init): Force initializer + element to register if it doesn't match general_operand. + 2016-07-05 Michael Meissner Bill Schmidt diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index ee0187c..9d2b2c0 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -6443,11 +6443,17 @@ s390_expand_vec_init (rtx target, rtx vals) /* Unfortunately the vec_init expander is not allowed to fail. So we have to implement the fallback ourselves. */ for (i = 0; i < n_elts; i++) - emit_insn (gen_rtx_SET (target, - gen_rtx_UNSPEC (mode, - gen_rtvec (3, XVECEXP (vals, 0, i), - GEN_INT (i), target), - UNSPEC_VEC_SET))); + { + rtx elem = XVECEXP (vals, 0, i); + if (!general_operand (elem, GET_MODE (elem))) + elem = force_reg (inner_mode, elem); + + emit_insn (gen_rtx_SET (target, + gen_rtx_UNSPEC (mode, + gen_rtvec (3, elem, + GEN_INT (i), target), + UNSPEC_VEC_SET))); + } } /* Structure to hold the initial parameters for a compare_and_swap operation