From patchwork Wed Jan 13 14:22:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Krebbel X-Patchwork-Id: 566956 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 B6FAF1402D9 for ; Thu, 14 Jan 2016 01:22:44 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=p8EBNFEk; 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:subject:message-id:mime-version:content-type; q=dns; s= default; b=FsF6MjIM12CLUIwRMzdKhEZorZO5pntZfdqRBl4iQ4iBJMJie4K/1 doq7+x9TSi8iAYggMwHraJ6pO1qzXKyrnowQh2t4+RZjaWmgjAuPTwMSjI9fH1Z4 qmwEyqB/RwaSzrzoRLF0TJtoZVkSQJLeOfojAeyqcvXZW0s1MthW7Y= 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:subject:message-id:mime-version:content-type; s= default; bh=WEknug60uuL14L32BY6lh92jxtg=; b=p8EBNFEkhou7/Zm8WjIl /ooGvwzqoYHVvQQ1IQi/pSPHQMFDJYBzGOeTioXvGpoNCd7Ilma1yUF0XgCSWJxa 31cfMCsxWE8tr1HjKpvAoOJ2w8s129NbSlUf2FXJy2OH3vdaX8zZt2bZzb1Ldoy4 lwscJPzftAQcNg6r0ysFlNQ= Received: (qmail 9173 invoked by alias); 13 Jan 2016 14:22:35 -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 8335 invoked by uid 89); 13 Jan 2016 14:22:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=Hx-languages-length:1641, Hx-cbid:sk:1601131, 114 X-HELO: e06smtp05.uk.ibm.com Received: from e06smtp05.uk.ibm.com (HELO e06smtp05.uk.ibm.com) (195.75.94.101) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Wed, 13 Jan 2016 14:22:34 +0000 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 13 Jan 2016 14:22:30 -0000 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 13 Jan 2016 14:22:28 -0000 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 b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id CB7272190019 for ; Wed, 13 Jan 2016 14:22:16 +0000 (GMT) Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u0DEMRov59900078 for ; Wed, 13 Jan 2016 14:22:28 GMT Received: from d06av11.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u0DEMRmw031688 for ; Wed, 13 Jan 2016 07:22:27 -0700 Received: from bart (dyn-9-152-212-123.boeblingen.de.ibm.com [9.152.212.123]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with SMTP id u0DEMQva031596 for ; Wed, 13 Jan 2016 07:22:26 -0700 Received: by bart (sSMTP sendmail emulation); Wed, 13 Jan 2016 15:22:26 +0100 Date: Wed, 13 Jan 2016 15:22:26 +0100 From: Andreas Krebbel To: gcc-patches@gcc.gnu.org Subject: [Committed] S/390: PR69247: Fix bswap hi splitter Message-ID: <20160113142226.GA25481@maggie> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16011314-0021-0000-0000-0000056FBB48 X-IsSubscribed: yes Hi, r231152 added a splitter which might invoke gen_reg_rtx after reload. Fixed with the attached patch. Bootstrapped and regtested on s390 and s390x. Committed to mainline. Bye, -Andreas- gcc/ChangeLog: 2016-01-13 Andreas Krebbel PR target/69247 * config/s390/s390.md (bswaphi splitter): Use simplify_gen_subreg. gcc/testsuite/ChangeLog: 2016-01-13 Jakub Jelinek PR target/69247 * gcc.dg/pr69247.c: New test. diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index d6097c1..3e340c3 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -10522,11 +10522,9 @@ (bswap:HI (match_operand:HI 1 "register_operand" "")))] "TARGET_CPU_ZARCH" [(set (match_dup 2) (bswap:SI (match_dup 3))) - (set (match_dup 2) (lshiftrt:SI (match_dup 2) - (const_int 16))) - (set (match_dup 0) (subreg:HI (match_dup 2) 2))] + (set (match_dup 2) (lshiftrt:SI (match_dup 2) (const_int 16)))] { - operands[2] = gen_reg_rtx (SImode); + operands[2] = simplify_gen_subreg (SImode, operands[0], HImode, 0); operands[3] = simplify_gen_subreg (SImode, operands[1], HImode, 0); }) diff --git a/gcc/testsuite/gcc.dg/pr69247.c b/gcc/testsuite/gcc.dg/pr69247.c new file mode 100644 index 0000000..b7406e6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr69247.c @@ -0,0 +1,14 @@ +/* PR target/69247 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +/* { dg-additional-options "-march=zEC12" { target s390*-*-* } } */ + +void foo (short *); + +void +bar (short x, int y) +{ + if (y) + x = x << 8 | (unsigned short) x >> 8; + foo (&x); +}