From patchwork Mon Nov 14 08:09:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tbsaunde+gcc@tbsaunde.org X-Patchwork-Id: 694396 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 3tHNJn5Vyhz9t0X for ; Mon, 14 Nov 2016 19:01:44 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="sS6mV4/B"; 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:from :to:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=HqkTprYzPZiFo9LNvUEGeI3P2bpwadY2EnGY4wXTDmBRZLAwGwV1e qbOtIaoa5Y+D3AGplueM/KPTpOzeFG6KR8dd+46tmEVz8hlbZ6WXiHkWSXfvTjcG M2N25pR0E0P3xIbH7hxAoHvhgmnRGHdgtt7GXLdK2k7ZxD+Rfo2AFI= 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:subject:date:message-id:in-reply-to:references; s=default; bh=Jl63ne6L4qQ+jUZ1jmRtLw0KuGw=; b=sS6mV4/BWST0Ttl4PGywGA5kSiqE kIIZ7vi0IyMOTj5KS7QrOFXbcxlyeuTl+n3L/tLbIuo2xAfhVhhd2noBdSp/a+L+ XoNm0PSa6YZMdi7Zzl/WY5hwpOzKv01YcVa1N8K/oFGryqn1aikj20V2ZQNuBmhs 5f6zcXtkewQg9V0= Received: (qmail 13959 invoked by alias); 14 Nov 2016 08:01:37 -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 13894 invoked by uid 89); 14 Nov 2016 08:01:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, SPF_FAIL autolearn=no version=3.3.2 spammy=trevor, Trevor, 1247, 2016-11-14 X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 14 Nov 2016 08:01:29 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c6CCl-0006fX-0Y for gcc-patches@gcc.gnu.org; Mon, 14 Nov 2016 03:01:27 -0500 Received: from [2600:3c03::f03c:91ff:fe6e:c625] (port=48148 helo=paperclip.tbsaunde.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6CCk-0006dz-SY for gcc-patches@gcc.gnu.org; Mon, 14 Nov 2016 03:01:26 -0500 Received: from keg.corp.tor1.mozilla.com (unknown [IPv6:2607:f0c8:8000:80e0:56ee:75ff:fe52:afb9]) by paperclip.tbsaunde.org (Postfix) with ESMTPSA id B4782C1A9 for ; Mon, 14 Nov 2016 08:01:24 +0000 (UTC) From: tbsaunde+gcc@tbsaunde.org To: gcc-patches@gcc.gnu.org Subject: [PATCH 04/11] make recog () take a rtx_insn * Date: Mon, 14 Nov 2016 03:09:27 -0500 Message-Id: <20161114080934.19056-5-tbsaunde+gcc@tbsaunde.org> In-Reply-To: <20161114080934.19056-1-tbsaunde+gcc@tbsaunde.org> References: <20161114080934.19056-1-tbsaunde+gcc@tbsaunde.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2600:3c03::f03c:91ff:fe6e:c625 X-IsSubscribed: yes From: Trevor Saunders gcc/ChangeLog: 2016-11-14 Trevor Saunders * config/v850/v850.c (expand_prologue): Adjust. (expand_epilogue): Likewise. * expr.c (init_expr_target): Likewise. * genrecog.c (print_subroutine): Always make the argument type rtx_insn *. * recog.h: Adjust prototype. --- gcc/config/v850/v850.c | 4 ++-- gcc/expr.c | 4 ++-- gcc/genrecog.c | 8 +------- gcc/recog.h | 2 +- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c index 91e182f..c27bb6d 100644 --- a/gcc/config/v850/v850.c +++ b/gcc/config/v850/v850.c @@ -1741,7 +1741,7 @@ expand_prologue (void) v850_all_frame_related (save_all); - code = recog (save_all, NULL_RTX, NULL); + code = recog (save_all, NULL, NULL); if (code >= 0) { rtx insn = emit_insn (save_all); @@ -1887,7 +1887,7 @@ expand_epilogue (void) offset -= 4; } - code = recog (restore_all, NULL_RTX, NULL); + code = recog (restore_all, NULL, NULL); if (code >= 0) { diff --git a/gcc/expr.c b/gcc/expr.c index 0b0946d..5d19699 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -109,7 +109,7 @@ static HOST_WIDE_INT int_expr_size (tree); void init_expr_target (void) { - rtx insn, pat; + rtx pat; machine_mode mode; int num_clobbers; rtx mem, mem1; @@ -125,7 +125,7 @@ init_expr_target (void) useless RTL allocations. */ reg = gen_rtx_REG (word_mode, LAST_VIRTUAL_REGISTER + 1); - insn = rtx_alloc (INSN); + rtx_insn *insn = as_a (rtx_alloc (INSN)); pat = gen_rtx_SET (NULL_RTX, NULL_RTX); PATTERN (insn) = pat; diff --git a/gcc/genrecog.c b/gcc/genrecog.c index a8e8c22..aa7f629 100644 --- a/gcc/genrecog.c +++ b/gcc/genrecog.c @@ -5102,8 +5102,7 @@ print_subroutine (output_state *os, state *s, int proc_id) /* For now, the top-level "recog" takes a plain "rtx", and performs a checked cast to "rtx_insn *" for use throughout the rest of the function and the code it calls. */ - const char *insn_param - = proc_id > 0 ? "rtx_insn *insn" : "rtx uncast_insn"; + const char *insn_param = "rtx_insn *insn"; printf ("\n"); switch (os->type) { @@ -5142,11 +5141,6 @@ print_subroutine (output_state *os, state *s, int proc_id) if (proc_id == 0) { printf (" recog_data.insn = NULL;\n"); - if (os->type == RECOG) - { - printf (" rtx_insn *insn ATTRIBUTE_UNUSED;\n"); - printf (" insn = safe_as_a (uncast_insn);\n"); - } } print_state (os, s, 2, true); printf ("}\n"); diff --git a/gcc/recog.h b/gcc/recog.h index 3a59af8..9f6c42c 100644 --- a/gcc/recog.h +++ b/gcc/recog.h @@ -124,7 +124,7 @@ extern int offsettable_address_addr_space_p (int, machine_mode, rtx, ADDR_SPACE_GENERIC) extern bool mode_dependent_address_p (rtx, addr_space_t); -extern int recog (rtx, rtx, int *); +extern int recog (rtx, rtx_insn *, int *); #ifndef GENERATOR_FILE static inline int recog_memoized (rtx_insn *insn); #endif