From patchwork Thu Mar 9 18:18:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Eager X-Patchwork-Id: 737094 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 3vfJYx3QVwz9s7n for ; Fri, 10 Mar 2017 05:18: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="GMvmpLhz"; 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:to :from:subject:cc:message-id:date:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=TsnGTbffCDU7VfCw ieAzLVX8RhJgSgUMKXM/Ln0W33wgU3guUde+ZtCas5W9Ctc1qpVHWKzlhVNcMzDi dnk2uI8XkSB70BpknjsapmuRAwL4m1+cu8e+8bvb+T264+jRW8YOhU8Edfqh2foG dXh0fFUYWiA0J6Ix5OP0cPy1qDM= 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:to :from:subject:cc:message-id:date:mime-version:content-type :content-transfer-encoding; s=default; bh=SHiXHLmdzcZL4FDi6Quex/ xqCGs=; b=GMvmpLhzEdECFHReF1feXv/QHwxjrzhmRWiIXWiQ7ZMZ92Cii6CWeq 5NjGrzJm7/UgP1Qn+o047/7bj4LuRBiAcmXiYei13K3aQN7Ng019a8rf7ITbXZ39 qaB8ib4fGKmCjIVTymBxw8ZLtTKe+rZ5NtzWm2upDy9KDKBvSB98U= Received: (qmail 79992 invoked by alias); 9 Mar 2017 18:18: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 79972 invoked by uid 89); 9 Mar 2017 18:18:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=Alto, palo, Palo, alto X-HELO: homiemail-a82.g.dreamhost.com Received: from sub5.mail.dreamhost.com (HELO homiemail-a82.g.dreamhost.com) (208.113.200.129) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 09 Mar 2017 18:18:47 +0000 Received: from homiemail-a82.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a82.g.dreamhost.com (Postfix) with ESMTP id 4E7556008829; Thu, 9 Mar 2017 10:18:44 -0800 (PST) Received: from vm-fedora21.eagercon.com (c-71-202-23-94.hsd1.ca.comcast.net [71.202.23.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: eager@eagerm.com) by homiemail-a82.g.dreamhost.com (Postfix) with ESMTPSA id 26406600882E; Thu, 9 Mar 2017 10:18:44 -0800 (PST) To: GCC Patches From: Michael Eager Subject: [PATCH] Microblaze: Fixes for RTL Checking Cc: Segher Boessenkool , Jakub Jelinek Message-ID: <58C19C83.9030405@eagerm.com> Date: Thu, 9 Mar 2017 10:18:43 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 X-IsSubscribed: yes 2017-03-09 Michael Eager Correct failures with --enable-checking=yes,rtl. * config/microblaze/microblaze.c (microblaze_expand_shift): Replace GET_CODE test with CONST_INT_P and INTVAL test with test for const0_rtx. * config/microblaze/microblaze.md (ashlsi3_byone, ashrsi3_byone, lshrsi3_byone): Replace INTVAL with test for const1_rtx. Committed revision 246012. diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c index 746bef1..fb115e6 100644 --- a/gcc/config/microblaze/microblaze.c +++ b/gcc/config/microblaze/microblaze.c @@ -3323,10 +3323,10 @@ microblaze_expand_shift (rtx operands[]) || (GET_CODE (operands[1]) == SUBREG)); /* Shift by zero -- copy regs if necessary. */ - if ((GET_CODE (operands[2]) == CONST_INT) && (INTVAL (operands[2]) == 0)) + if (CONST_INT_P (operands[2]) && (operands[2] == const0_rtx) + && !rtx_equal_p (operands[0], operands[1])) { - if (REGNO (operands[0]) != REGNO (operands[1])) - emit_insn (gen_movsi (operands[0], operands[1])); + emit_insn (gen_movsi (operands[0], operands[1])); return 1; } diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md index 66ebc1e..b3a0011 100644 --- a/gcc/config/microblaze/microblaze.md +++ b/gcc/config/microblaze/microblaze.md @@ -1321,7 +1321,7 @@ [(set (match_operand:SI 0 "register_operand" "=d") (ashift:SI (match_operand:SI 1 "register_operand" "d") (match_operand:SI 2 "arith_operand" "I")))] - "(INTVAL (operands[2]) == 1)" + "(operands[2] == const1_rtx)" "addk\t%0,%1,%1" [(set_attr "type" "arith") (set_attr "mode" "SI") @@ -1482,7 +1482,7 @@ [(set (match_operand:SI 0 "register_operand" "=d") (ashiftrt:SI (match_operand:SI 1 "register_operand" "d") (match_operand:SI 2 "arith_operand" "I")))] - "(INTVAL (operands[2]) == 1)" + "(operands[2] == const1_rtx)" "sra\t%0,%1" [(set_attr "type" "arith") (set_attr "mode" "SI") @@ -1571,7 +1571,7 @@ [(set (match_operand:SI 0 "register_operand" "=d") (lshiftrt:SI (match_operand:SI 1 "register_operand" "d") (match_operand:SI 2 "arith_operand" "I")))] - "(INTVAL (operands[2]) == 1)" + "(operands[2] == const1_rtx)" "srl\t%0,%1" [(set_attr "type" "arith") (set_attr "mode" "SI")