From patchwork Fri Nov 22 08:26:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 293366 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 37AEB2C0096 for ; Fri, 22 Nov 2013 19:27:21 +1100 (EST) 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:mime-version:content-type; q=dns; s=default; b=KdjJ2zAdavV9hD3hhGkbM4VmT1smxIpIuoZUuQoe1CSB8H6iVR 1StFPl9ief3AxUR/sFUPzfWjvmWAbHzu/gLRvwNuE2SorRr7FhMJspHQeO6TYF3Z Tmt0cl6H5yfzideqSS3Go2Jm5o/jiZjUxQhfv7KKVZ1ZFJjC6o+6VXZa8= 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:mime-version:content-type; s= default; bh=U9mvf3o8XfvE/gAtOzLzbe5qOBQ=; b=B3lZrC1Q8vlqoLA0mYak 8eLS6GbiF/3HL08g6yvG0TC7qkULTj9bZTaRlYiQskU3iC+6Jbml8NMznwdSIysh jafpSga0pLHDRGjFtwLYVc1hP1eizKCssVWAJShCXh33fjeHTniAvm/TDXsd51tl 35wrMr7tgvpDgLtM20NgSEs= Received: (qmail 13159 invoked by alias); 22 Nov 2013 08:27:10 -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 13146 invoked by uid 89); 22 Nov 2013 08:27:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL, BAYES_05, FREEMAIL_FROM, RDNS_NONE, SPF_PASS, URIBL_BLOCKED autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-wg0-f50.google.com Received: from Unknown (HELO mail-wg0-f50.google.com) (74.125.82.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 22 Nov 2013 08:27:07 +0000 Received: by mail-wg0-f50.google.com with SMTP id k14so812576wgh.29 for ; Fri, 22 Nov 2013 00:26:58 -0800 (PST) X-Received: by 10.180.210.237 with SMTP id mx13mr1637640wic.4.1385108818631; Fri, 22 Nov 2013 00:26:58 -0800 (PST) Received: from localhost ([2.28.235.51]) by mx.google.com with ESMTPSA id bk7sm13628195wib.10.2013.11.22.00.26.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Nov 2013 00:26:58 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, kkojima@gcc.gnu.org, rdsandiford@googlemail.com Cc: kkojima@gcc.gnu.org Subject: [sh] Avoid genrecog warning Date: Fri, 22 Nov 2013 08:26:57 +0000 Message-ID: <871u286dv2.fsf@talisman.default> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 I have a patch to upgrade most genrecog warnings into errors. This patch fixes the ones for sh. There were some warnings about the match_operands in some define_peephole2s having constraints. There were also a few cases where a destination predicate allowed a constant. Tested by building sh-elf with the warnings turned to errors, and by comparing the before and after assembly output at -O2 for gcc.c-torture, gcc.dg and g++.dg. OK to install? Thanks, Richard gcc/ * config/sh/sh.md: Use nonimmediate_operand rather than general_operand for the destination of a define_peephole2. Likewise register_operand rather than arith_reg_operand. Remove constraints from define_peephole2s. Index: gcc/config/sh/sh.md =================================================================== --- gcc/config/sh/sh.md 2013-11-16 21:52:15.083787117 +0000 +++ gcc/config/sh/sh.md 2013-11-16 21:59:05.056092176 +0000 @@ -6065,7 +6065,7 @@ (define_insn "*zero_extendsi2_disp (define_peephole2 [(set (match_operand:SI 0 "arith_reg_dest" "") (zero_extend:SI (match_operand 1 "displacement_mem_operand" ""))) - (set (match_operand 2 "general_operand" "") + (set (match_operand 2 "nonimmediate_operand" "") (match_operand 3 "arith_reg_operand" ""))] "TARGET_SH2A && REGNO (operands[0]) == REGNO (operands[3]) @@ -13700,13 +13700,13 @@ (define_insn "bxorreg_m2a" ;; ------------------------------------------------------------------------- ;; This matches cases where the bit in a memory location is set. (define_peephole2 - [(set (match_operand:SI 0 "arith_reg_operand" "r,r") - (sign_extend:SI (match_operand:QI 1 "bitwise_memory_operand" "Sbw,Sbv"))) + [(set (match_operand:SI 0 "register_operand") + (sign_extend:SI (match_operand:QI 1 "bitwise_memory_operand"))) (set (match_dup 0) (ior:SI (match_dup 0) - (match_operand:SI 2 "const_int_operand" "Pso,Pso"))) + (match_operand:SI 2 "const_int_operand"))) (set (match_dup 1) - (match_operand 3 "arith_reg_operand" "r,r"))] + (match_operand 3 "arith_reg_operand"))] "TARGET_SH2A && TARGET_BITOPS && satisfies_constraint_Pso (operands[2]) && REGNO (operands[0]) == REGNO (operands[3])" @@ -13716,13 +13716,13 @@ (define_peephole2 ;; This matches cases where the bit in a memory location is cleared. (define_peephole2 - [(set (match_operand:SI 0 "arith_reg_operand" "r,r") - (sign_extend:SI (match_operand:QI 1 "bitwise_memory_operand" "Sbw,Sbv"))) + [(set (match_operand:SI 0 "register_operand") + (sign_extend:SI (match_operand:QI 1 "bitwise_memory_operand"))) (set (match_dup 0) (and:SI (match_dup 0) - (match_operand:SI 2 "const_int_operand" "Psz,Psz"))) + (match_operand:SI 2 "const_int_operand"))) (set (match_dup 1) - (match_operand 3 "arith_reg_operand" "r,r"))] + (match_operand 3 "arith_reg_operand"))] "TARGET_SH2A && TARGET_BITOPS && satisfies_constraint_Psz (operands[2]) && REGNO (operands[0]) == REGNO (operands[3])"