From patchwork Fri Nov 22 08:15:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 293359 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 5D3E32C00CB for ; Fri, 22 Nov 2013 19:16:25 +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=rm0h6Rz8RPz/qb+hfA43o/znQfQg+bH9W7CEz3JYQjg8oBPfG7 m2VlQBVLDyvlaikDFtYmnkVm/nuENaPj6ZLJ2CVnidpG4n33ZdEbgtSqVsrtekt4 7GF38JjuNsllz1gEncM+Qa4OGZA9eNZyAv8zjyp7XJsIJtLQmWjLxsI88= 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=MsCJIUyHbWjjqBVkvgbuMTPUF6g=; b=FeTJb1aVeWS5AVEJ20vc KDXTlKBTl4yAnNb7L6vb6KxQVGHpjrIrPJYx0YRWIy/xFQiEqRx4kM/4TCjrQ8Sp qo3d4wRb52vSpEzeJRDtVNP5bspetxMvPgzup4FESO71FFT10APLkL4I1PcQK1BH Ou+9+mQygixb/2whUVJvQIM= Received: (qmail 1844 invoked by alias); 22 Nov 2013 08:16:15 -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 1828 invoked by uid 89); 22 Nov 2013 08:16:14 -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_40, FREEMAIL_FROM, RDNS_NONE, SPF_PASS, URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mail-we0-f172.google.com Received: from Unknown (HELO mail-we0-f172.google.com) (74.125.82.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 22 Nov 2013 08:15:51 +0000 Received: by mail-we0-f172.google.com with SMTP id t60so807190wes.31 for ; Fri, 22 Nov 2013 00:15:42 -0800 (PST) X-Received: by 10.194.5.7 with SMTP id o7mr9161642wjo.17.1385108142821; Fri, 22 Nov 2013 00:15:42 -0800 (PST) Received: from localhost ([2.28.235.51]) by mx.google.com with ESMTPSA id dn2sm13290597wid.1.2013.11.22.00.15.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Nov 2013 00:15:42 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, bernds@codesourcery.com, jzhang918@gmail.com, rdsandiford@googlemail.com Cc: bernds@codesourcery.com, jzhang918@gmail.com Subject: [bfin] Avoid genrecog warning Date: Fri, 22 Nov 2013 08:15:41 +0000 Message-ID: <87eh686edu.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 one for bfin about {push,pop}_multiple_operation not being defined at the .md level. Tested by building bfin-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/bfin/bfin-protos.h (push_multiple_operation): Delete. (pop_multiple_operation): Delete. (push_multiple_operation_p, pop_multiple_operation_p): Declare. * config/bfin/bfin.c (push_multiple_operation): Rename to... (push_multiple_operation_p): ...this and remove mode argument. (pop_multiple_operation): Rename to... (pop_multiple_operation_p): ...this and remove mode argument. * config/bfin/predicates.md (push_multiple_operation): Define. (pop_multiple_operation): Likewise. Index: gcc/config/bfin/bfin-protos.h =================================================================== --- gcc/config/bfin/bfin-protos.h 2013-11-16 21:52:15.083787117 +0000 +++ gcc/config/bfin/bfin-protos.h 2013-11-16 21:58:55.616017138 +0000 @@ -105,8 +105,8 @@ extern rtx bfin_va_arg (tree, tree); extern void bfin_expand_prologue (void); extern void bfin_expand_epilogue (int, int, bool); -extern int push_multiple_operation (rtx, enum machine_mode); -extern int pop_multiple_operation (rtx, enum machine_mode); +extern int push_multiple_operation_p (rtx); +extern int pop_multiple_operation_p (rtx); extern void output_push_multiple (rtx, rtx *); extern void output_pop_multiple (rtx, rtx *); extern int bfin_hard_regno_rename_ok (unsigned int, unsigned int); Index: gcc/config/bfin/bfin.c =================================================================== --- gcc/config/bfin/bfin.c 2013-11-16 21:52:15.083787117 +0000 +++ gcc/config/bfin/bfin.c 2013-11-16 21:58:55.616017138 +0000 @@ -2990,7 +2990,7 @@ bfin_rtx_costs (rtx x, int code_i, int o static int n_regs_to_save; int -push_multiple_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +push_multiple_operation_p (rtx op) { int lastdreg = 8, lastpreg = 6; int i, group; @@ -3061,7 +3061,7 @@ push_multiple_operation (rtx op, enum ma } int -pop_multiple_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +pop_multiple_operation_p (rtx op) { int lastdreg = 8, lastpreg = 6; int i, group; @@ -3130,7 +3130,7 @@ output_push_multiple (rtx insn, rtx *ope int ok; /* Validate the insn again, and compute first_[dp]reg_to_save. */ - ok = push_multiple_operation (PATTERN (insn), VOIDmode); + ok = push_multiple_operation_p (PATTERN (insn)); gcc_assert (ok); if (first_dreg_to_save == 8) @@ -3154,7 +3154,7 @@ output_pop_multiple (rtx insn, rtx *oper int ok; /* Validate the insn again, and compute first_[dp]reg_to_save. */ - ok = pop_multiple_operation (PATTERN (insn), VOIDmode); + ok = pop_multiple_operation_p (PATTERN (insn)); gcc_assert (ok); if (first_dreg_to_save == 8) @@ -4134,8 +4134,8 @@ workaround_rts_anomaly (void) if (GET_CODE (pat) == PARALLEL) { - if (push_multiple_operation (pat, VOIDmode) - || pop_multiple_operation (pat, VOIDmode)) + if (push_multiple_operation_p (pat) + || pop_multiple_operation_p (pat)) this_cycles = n_regs_to_save; } else Index: gcc/config/bfin/predicates.md =================================================================== --- gcc/config/bfin/predicates.md 2013-11-16 21:52:15.083787117 +0000 +++ gcc/config/bfin/predicates.md 2013-11-16 21:58:55.617017146 +0000 @@ -239,3 +239,11 @@ (define_predicate "mem_i_address_operand gcc_assert (REG_P (op)); return IREG_P (op); }) + +(define_predicate "push_multiple_operation" + (and (match_code "parallel") + (match_test "push_multiple_operation_p (op)"))) + +(define_predicate "pop_multiple_operation" + (and (match_code "parallel") + (match_test "pop_multiple_operation_p (op)")))