From patchwork Sun Dec 27 19:38:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Edlinger X-Patchwork-Id: 561193 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 CD5E8140CA7 for ; Mon, 28 Dec 2015 06:38:31 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=k2X9hIN7; 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:cc:subject:date:message-id:content-type:mime-version; q=dns; s=default; b=khe2wmwkcrCF2Z2B6BDr0fj81/LsuBcwaRonB8GWw28+J+0h71 gLqJ/xp4QidnsFpttX8VS6SxRoooVrpORfK5AJk53yz4922DN7O05uz+Phnz9MPV 6W9dYfFl0XMfuZPIR0JBVTGz0UuhGdiz+kcexcpGpwdNAF88wZobmM2v0= 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:cc:subject:date:message-id:content-type:mime-version; s= default; bh=hvlYkJreB1o55jgYn70KBODLnbI=; b=k2X9hIN7jYubyLAXtLvx IhqZ70IAVnybVEMxNe2PYwJ68A8Wa9/ZKKaekTHkz9W4EO1P8ugF00eOGdP/vpgF J2fFLtZQXRSEDPt5RPQP61kCD8a0uJ/R1HpQtZFBHDlNeEMPPJFSPpnmosMmVwl8 tIu2LVmlvzb/B8xN1V3ftvc= Received: (qmail 1876 invoked by alias); 27 Dec 2015 19:38:24 -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 1860 invoked by uid 89); 27 Dec 2015 19:38:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=berndedlingerhotmailde, bernd.edlinger@hotmail.de, Hx-languages-length:1289, H*c:HHH X-HELO: DUB004-OMC2S19.hotmail.com Received: from dub004-omc2s19.hotmail.com (HELO DUB004-OMC2S19.hotmail.com) (157.55.1.158) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA256 encrypted) ESMTPS; Sun, 27 Dec 2015 19:38:21 +0000 Received: from emea01-db3-obe.outbound.protection.outlook.com ([157.55.1.138]) by DUB004-OMC2S19.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Sun, 27 Dec 2015 11:38:18 -0800 Received: from HE1PR07MB0908.eurprd07.prod.outlook.com (10.162.26.15) by HE1PR07MB0939.eurprd07.prod.outlook.com (10.162.27.145) with Microsoft SMTP Server (TLS) id 15.1.361.13; Sun, 27 Dec 2015 19:38:17 +0000 Received: from HE1PR07MB0905.eurprd07.prod.outlook.com (10.162.26.12) by HE1PR07MB0908.eurprd07.prod.outlook.com (10.162.26.15) with Microsoft SMTP Server (TLS) id 15.1.361.13; Sun, 27 Dec 2015 19:38:17 +0000 Received: from HE1PR07MB0905.eurprd07.prod.outlook.com ([10.162.26.12]) by HE1PR07MB0905.eurprd07.prod.outlook.com ([10.162.26.12]) with mapi id 15.01.0361.006; Sun, 27 Dec 2015 19:38:17 +0000 From: Bernd Edlinger To: "gcc-patches@gcc.gnu.org" CC: Walter Lee Subject: [PATCH] Fix pr68917 ICE on __builtin_clz for tilegx Date: Sun, 27 Dec 2015 19:38:16 +0000 Message-ID: authentication-results: tilera.com; dkim=none (message not signed) header.d=none; tilera.com; dmarc=none action=none header.from=hotmail.de; x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [p2Wtf9zDNB+leov2mmmJU5q3zhie4zVw] x-microsoft-exchange-diagnostics: 1; HE1PR07MB0908; 23:GDoil6dMEYt1+1hHn/qtQImmYYtSFJqAnQuAy8Jf9hVOv3Zok/YGPX5uMqzfCihSb1TANeEUZk+a/kewMdG+pCjq4jPTSxUL7Mh1ljBF59H+kE9e3qjtkTVfUQabUOf95rE3CAg7dv92fz5PRBjxuue3GA2PGCos5YdT5Jq9RyvMOK6ji3fm2ZtP/eDpPL2UJc8ePkxB0Q0rLitDoQceew==; 5:9dAIXlpLFqPX6rG1+41DQwGLTKk29kH8qZDMy+qX4zGCKtw0VEb8uKh+6Ed6JAmbh5cjyS+bOUFKNnyOYIVNvJ8gAHV1ed+Rd7g/dvPwj/DI/tXiW+X9z5FTeoh4KDqBL6AqG/fXMhJM49mhnAxY6A==; 24:Ul54duHJMNw/cXb2Qb6+pEnXNvxAteuvpkloW41g09ltFnGQzSMG/zwDNKfCGBP0kTedMsm6VZ32H36jt8d51lRRxf+vmFGqJGRcxKNdNM4= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HE1PR07MB0908; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(432015012)(82015046); SRVR:HE1PR07MB0908; BCL:0; PCL:0; RULEID:; SRVR:HE1PR07MB0908; x-forefront-prvs: 0803A0241F x-forefront-antispam-report: SFV:NSPM; SFS:(7070004)(98900002); DIR:OUT; SFP:1901; SCL:1; SRVR:HE1PR07MB0908; H:HE1PR07MB0905.eurprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2015 19:38:16.8363 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR07MB0908 X-Microsoft-Exchange-Diagnostics: 1; HE1PR07MB0939; 2:ZwjhVTB6fUaczhhwzpc1cqJ/26gChFB8hkp/0rpTpNdozblzX7pwgCePMp9txNiZKGpIRfPA+bC8DICg1Gq6bTKWyo4mYUp8uoA3ULuHNAgLe1zjqRodNMPm9cmTpYvJUjU4ssWGnhDtRH+C8sw69A==; 23:AG9hpEMrKF67q9dq7uey18akcTvV1mGMdcSpJhpxlm5PA/nupOnTCaGbiiBRniK4SbJJgwmDwRSIrnkU+RTL5PbARBsJZdmq2kHK+Rq0Y+Lp2qp1J/bnctj4k32kGGwF9kgku8zdFaazWHYGisesLHtWMUieo2VXHsdUAkXPRR0= X-OriginatorOrg: sct-15-1-318-9-msonline-outlook-efc2f.templateTenant Hi, due to more thorough checks in the middle end the builtin clz instruction causes now an ICE on the tilegx target. I have built a tilegx-cross-comiler and inspected the generated code to verify that the patch works. Is is OK for trunk? Thanks Bernd. 2015-12-27 Bernd Edlinger PR target/68917 * config/tilegx/tilegx.md (clzsi2): Don't create DI subregs of SI values. Explicitly convert SI to DI and vice-versa. Index: gcc/config/tilegx/tilegx.md =================================================================== --- gcc/config/tilegx/tilegx.md (revision 231954) +++ gcc/config/tilegx/tilegx.md (working copy) @@ -1799,13 +1799,16 @@ (define_expand "clzsi2" [(set (match_dup 2) - (ashift:DI (match_operand:SI 1 "reg_or_0_operand" "") + (zero_extend:DI (match_operand:SI 1 "reg_or_0_operand" ""))) + (set (match_dup 2) + (ashift:DI (match_dup 2) (const_int 32))) - (set (subreg:DI (match_operand:SI 0 "register_operand" "") 0) - (clz:DI (match_dup 2)))] + (set (match_dup 2) + (clz:DI (match_dup 2))) + (set (match_operand:SI 0 "register_operand" "") + (subreg:SI (match_dup 2) 0))] "" { - operands[1] = simplify_gen_subreg (DImode, operands[1], SImode, 0); operands[2] = gen_reg_rtx (DImode); })