From patchwork Fri Sep 5 01:52:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 386077 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 A15DA140090 for ; Fri, 5 Sep 2014 11:48:11 +1000 (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:in-reply-to:references; q=dns; s= default; b=KYL8C/aKOzE7hX5nPGfhTyqd5Ggt8HhHGfNaaPC6YN/3f9G7tRe+j y/js34+viTyOk7HdfAtyzag0UtTMJ2p82S0D40B0UGWlKkvfNP8L1Ai7QAOJ7uEh eKjQI6+NW3tMGMURYINkWK8+T+dNnOhn8pVpUHw/uuuVMXqSZZ3OW8= 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:in-reply-to:references; s= default; bh=ZUM0X4m7LWC/q/hzGUmKJze757s=; b=KX9IBty0BIl9M9+Xr0Fm 452yIaMr+njCLCdjrG4GN0hUOeZvg9cADm4fc/lZMf9cPOxSVCXsw/sjyIwBQZMa bjNjJjD0JEUtyVNlNc7JlEDq4DcqnILeFN4EqrA4ggUjNL118paltR3cALpSO2MF FXqDaHMzAozVzUNCscmNkS4= Received: (qmail 15366 invoked by alias); 5 Sep 2014 01:47:06 -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 15202 invoked by uid 89); 5 Sep 2014 01:47:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 05 Sep 2014 01:47:04 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s851l3QH013401 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 4 Sep 2014 21:47:03 -0400 Received: from c64.redhat.com (vpn-228-103.phx2.redhat.com [10.3.228.103]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s851kw8i012763; Thu, 4 Sep 2014 21:47:02 -0400 From: David Malcolm To: gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [PATCH 06/10] Use rtx_insn more within peep2 Date: Thu, 4 Sep 2014 21:52:03 -0400 Message-Id: <1409881927-61672-7-git-send-email-dmalcolm@redhat.com> In-Reply-To: <1409881927-61672-1-git-send-email-dmalcolm@redhat.com> References: <1409881927-61672-1-git-send-email-dmalcolm@redhat.com> X-IsSubscribed: yes gcc/ * recog.c (peep2_attempt): Strengthen return type from rtx to rtx_insn *. (peep2_update_life): Likewise for params "last", "prev", removing a checked cast made redundant by this. (peephole2_optimize): Likewise for local "last". --- gcc/recog.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gcc/recog.c b/gcc/recog.c index 469dfe6..d07a57a 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -3160,7 +3160,7 @@ peep2_reinit_state (regset live) replacing them with ATTEMPT. Returns the last insn emitted, or NULL if the replacement is rejected. */ -static rtx +static rtx_insn * peep2_attempt (basic_block bb, rtx uncast_insn, int match_len, rtx_insn *attempt) { rtx_insn *insn = safe_as_a (uncast_insn); @@ -3396,7 +3396,8 @@ peep2_attempt (basic_block bb, rtx uncast_insn, int match_len, rtx_insn *attempt matched, and which now need to be replaced in the buffer. */ static void -peep2_update_life (basic_block bb, int match_len, rtx last, rtx prev) +peep2_update_life (basic_block bb, int match_len, rtx_insn *last, + rtx_insn *prev) { int i = peep2_buf_position (peep2_current + match_len + 1); rtx_insn *x; @@ -3408,7 +3409,7 @@ peep2_update_life (basic_block bb, int match_len, rtx last, rtx prev) gcc_assert (peep2_current_count >= match_len + 1); peep2_current_count -= match_len + 1; - x = as_a (last); + x = last; do { if (INSN_P (x)) @@ -3538,7 +3539,7 @@ peephole2_optimize (void) peephole2_insns (PATTERN (head), head, &match_len)); if (attempt != NULL) { - rtx last = peep2_attempt (bb, head, match_len, attempt); + rtx_insn *last = peep2_attempt (bb, head, match_len, attempt); if (last) { peep2_update_life (bb, match_len, last, PREV_INSN (attempt));