From patchwork Thu Jan 24 15:36:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wilco Dijkstra X-Patchwork-Id: 1030523 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-494675-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="K2ubpKK0"; dkim=pass (1024-bit key; unprotected) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.b="Fdn1gZ+k"; dkim-atps=neutral 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 43lmVP2fBqz9s1l for ; Fri, 25 Jan 2019 02:36:58 +1100 (AEDT) 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 :content-transfer-encoding:mime-version; q=dns; s=default; b=biM vtGA8uW7uTEuTZiyR4R0/BfjTWkIuSUwpuI/05zaMlRcgjj6A+9FITfKU+EpKWm+ Z8MIirs4TExVUeR34HhWkKJVkouFUE7Raxdqgyq9izmTCmNbCFCyp77sKcpwkSUm 8r7QV4W8UH+ZxOqQSMCMXNTNo8HytEmx4bUIm8rA= 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 :content-transfer-encoding:mime-version; s=default; bh=/1gLLY0cw IFxzO93DD6tzkJ8mp8=; b=K2ubpKK05qY5oMOYowT/4WLwgfc5vAB4K/oE1N3VC VXCr3jKhRrD4NtEDSNpl0eqfdP3HdX6HT+pOrXEol+AatVjGwB+3JNDXYImYrIc1 NemJJDoYGfCGxsthVphodViT8zEFfSkwS18jULabXwks5QOM5oyhv7QX/GXiHfMD Mw= Received: (qmail 79443 invoked by alias); 24 Jan 2019 15:36:51 -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 79143 invoked by uid 89); 24 Jan 2019 15:36:51 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: EUR03-VE1-obe.outbound.protection.outlook.com Received: from mail-eopbgr50040.outbound.protection.outlook.com (HELO EUR03-VE1-obe.outbound.protection.outlook.com) (40.107.5.40) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 24 Jan 2019 15:36:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R3Yj9y4HRj5c49LBNW7Gme0H09cc1s+XPoRP2AwJVVQ=; b=Fdn1gZ+klixQ7g3JBVaXfIOfovvrvwNeEQwwbY9pow5lCuEo2ovIlCHwYUgK8n2wGQyX6gleCSr/X0wB0T2dBixDzQmAvcrxxWK3igZXVFwu0UD7wr/fe1/utphQ1PHDaSsOD9UvMSgKv6ACymzP5s7tlklzD/CWsrD3TnRlT8w= Received: from DB5PR08MB1030.eurprd08.prod.outlook.com (10.166.14.15) by DB5PR08MB0856.eurprd08.prod.outlook.com (10.164.43.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.16; Thu, 24 Jan 2019 15:36:46 +0000 Received: from DB5PR08MB1030.eurprd08.prod.outlook.com ([fe80::38d8:974d:5d5d:3a8a]) by DB5PR08MB1030.eurprd08.prod.outlook.com ([fe80::38d8:974d:5d5d:3a8a%3]) with mapi id 15.20.1558.016; Thu, 24 Jan 2019 15:36:46 +0000 From: Wilco Dijkstra To: GCC Patches , James Greenhalgh , Richard Earnshaw CC: nd Subject: [PATCH][AArch64] Fix generation of tst (PR87763) Date: Thu, 24 Jan 2019 15:36:46 +0000 Message-ID: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wilco.Dijkstra@arm.com; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 MIME-Version: 1.0 The TST instruction no longer matches in all cases due to changes in Combine. The fix is simple, we now need to allow a subreg as well when selecting the cc_mode. This fixes the tst_5.c and tst_6.c failures. AArch64 regress & bootstrap OK. ChangeLog: 2019-01-23 Wilco Dijkstra PR rtl-optimization/87763 * config/aarch64/aarch64.c (aarch64_select_cc_mode): Allow SUBREG when matching CC_NZmode compare. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index a0006dc1f8a921dd83209d4404132a1fe3cfcd1e..237428d28b4f20ddfefee83ed020e209011147a0 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -7120,7 +7120,7 @@ aarch64_select_cc_mode (RTX_CODE code, rtx x, rtx y) /* Equality comparisons of short modes against zero can be performed using the TST instruction with the appropriate bitmask. */ - if (y == const0_rtx && REG_P (x) + if (y == const0_rtx && (REG_P (x) || SUBREG_P (x)) && (code == EQ || code == NE) && (GET_MODE (x) == HImode || GET_MODE (x) == QImode)) return CC_NZmode;