From patchwork Thu Nov 17 09:26:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyrill Tkachov X-Patchwork-Id: 696037 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 3tKG3k2fbnz9t1Q for ; Thu, 17 Nov 2016 20:26:58 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="vs2yy9Hq"; 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 :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=pYl7PbqdlXkqHRDqyavskLjPAWTc6T622bzjfSoEk4N viHndQy4GgjINzh6ZYj+gGWZDIGUW8eHJSQGWyhZy51ezJtPA+7czyIhJYBtzAKJ 1ZtnOefbKZb0Gm/kLWzk6ynp4Yx0DAtVFXzZFxWOl70QDJNHYcwDABr2GrVBfCBg = 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 :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=lZG7IRb3HR8UANSdgQGtt9/baQg=; b=vs2yy9HqFaopmTgPl lGl60X2+TcwSpxInI4cPcMUFsVuhciLLv5ACTg99sLvvpV1vgOjc9z8SQwdTnGc9 oIwLOraRItzvkguTAtXHYldMcL9D8qVNc/Bz6WPyw+nNDZ7vO3Yj7PfgS39tryZH AIn/haLGrL3x6/fm8vtbB58/hE= Received: (qmail 70923 invoked by alias); 17 Nov 2016 09:26:49 -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 70914 invoked by uid 89); 17 Nov 2016 09:26:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Hx-languages-length:2076, match_code, family, 2016-11-17 X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 17 Nov 2016 09:26:39 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D026028; Thu, 17 Nov 2016 01:26:37 -0800 (PST) Received: from [10.2.207.77] (e100706-lin.cambridge.arm.com [10.2.207.77]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1AE0E3F318; Thu, 17 Nov 2016 01:26:36 -0800 (PST) Message-ID: <582D77CB.9090606@foss.arm.com> Date: Thu, 17 Nov 2016 09:26:35 +0000 From: Kyrill Tkachov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: GCC Patches CC: Marcus Shawcroft , Richard Earnshaw , James Greenhalgh Subject: [PATCH][AArch64] Fix gcc.dg/torture/float32-builtin.c with RTL checking Hi all, Testing with RTL checking enabled showed another failure in gcc.dg/torture/float32-builtin.c. aarch64_float_const_zero_rtx_p was passed down a complex subreg expression during combine/recog. The pattern was supposed to reject that expression but it made its way to aarch64_float_const_zero_rtx_p which is only supposed to handle CONST_DOUBLEs. The culprit is the aarch64_reg_or_fp_zero predicate that restricts the accepted codes to reg,subreg,const_double but passes down anything that is not a reg into aarch64_float_const_zero_rtx_p. That includes SUBREGs that do not match register_operand, which we want to reject. This patch checks that the argument is a CONST_DOUBLE before passing it to aarch64_float_const_zero_rtx_p Bootstrapped and tested on aarch64-none-linux-gnu with RTL checking enabled. Ok for trunk? Thanks, Kyrill P.S. This predicate is only used in the store-pair family of patterns. 2016-11-17 Kyrylo Tkachov * config/aarch64/predicates.md (aarch64_reg_or_fp_zero): Check for const_double code before calling aarch64_float_const_zero_rtx_p. commit 950f8638a894aa699d1743fc3277b0aee3009fb7 Author: Kyrylo Tkachov Date: Tue Nov 15 16:04:39 2016 +0000 [AArch64] Fix gcc.dg/torture/float32-builtin.c with RTL checking diff --git a/gcc/config/aarch64/predicates.md b/gcc/config/aarch64/predicates.md index ebda6d8..0671cc8 100644 --- a/gcc/config/aarch64/predicates.md +++ b/gcc/config/aarch64/predicates.md @@ -54,9 +54,9 @@ (define_predicate "aarch64_reg_or_zero" (match_test "op == const0_rtx")))) (define_predicate "aarch64_reg_or_fp_zero" - (and (match_code "reg,subreg,const_double") - (ior (match_operand 0 "register_operand") - (match_test "aarch64_float_const_zero_rtx_p (op)")))) + (ior (match_operand 0 "register_operand") + (and (match_code "const_double") + (match_test "aarch64_float_const_zero_rtx_p (op)")))) (define_predicate "aarch64_reg_zero_or_m1_or_1" (and (match_code "reg,subreg,const_int")