From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 512 invoked by alias); 6 Aug 2014 17:44:40 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 443 invoked by uid 89); 6 Aug 2014 17:44:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 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 (AES256-SHA encrypted) ESMTPS; Wed, 06 Aug 2014 17:44:38 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XF4t3-0000un-Ad for gcc-patches@gcc.gnu.org; Wed, 06 Aug 2014 13:20:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54205) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF4t2-0000ue-SY for gcc-patches@gcc.gnu.org; Wed, 06 Aug 2014 13:20:29 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s76HJSBT023413 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 6 Aug 2014 13:19:28 -0400 Received: from c64.redhat.com (vpn-239-139.phx2.redhat.com [10.3.239.139]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s76HJ2oJ030913; Wed, 6 Aug 2014 13:19:27 -0400 From: David Malcolm To: gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [PATCH 043/236] peephole returns an rtx_insn Date: Wed, 06 Aug 2014 17:45:00 -0000 Message-Id: <1407345815-14551-44-git-send-email-dmalcolm@redhat.com> In-Reply-To: <1407345815-14551-1-git-send-email-dmalcolm@redhat.com> References: <1407345815-14551-1-git-send-email-dmalcolm@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg00697.txt.bz2 gcc/ * output.h (peephole): Strengthen return type from rtx to rtx_insn *. * rtl.h (delete_for_peephole): Likewise for both params. * genpeep.c (main): In generated "peephole" function, strengthen return type and local "insn" from rtx to rtx_insn *. For now, rename param "ins1" to "uncast_ins1", adding "ins1" back as an rtx_insn *, with a checked cast. * jump.c (delete_for_peephole): Strengthen params "from", "to" and locals "insn", "next", "prev" from rtx to rtx_insn *. --- gcc/genpeep.c | 6 ++++-- gcc/jump.c | 8 ++++---- gcc/output.h | 2 +- gcc/rtl.h | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/gcc/genpeep.c b/gcc/genpeep.c index a8afadb..bc2785e 100644 --- a/gcc/genpeep.c +++ b/gcc/genpeep.c @@ -378,8 +378,10 @@ from the machine description file `md'. */\n\n"); printf ("extern rtx peep_operand[];\n\n"); printf ("#define operands peep_operand\n\n"); - printf ("rtx\npeephole (rtx ins1)\n{\n"); - printf (" rtx insn ATTRIBUTE_UNUSED, x ATTRIBUTE_UNUSED, pat ATTRIBUTE_UNUSED;\n\n"); + printf ("rtx_insn *\npeephole (rtx uncast_ins1)\n{\n"); + printf (" rtx_insn *ins1 = as_a (uncast_ins1);\n"); + printf (" rtx_insn *insn ATTRIBUTE_UNUSED;\n"); + printf (" rtx x ATTRIBUTE_UNUSED, pat ATTRIBUTE_UNUSED;\n\n"); /* Early out: no peepholes for insns followed by barriers. */ printf (" if (NEXT_INSN (ins1)\n"); diff --git a/gcc/jump.c b/gcc/jump.c index 0cac620..1a150ac 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -1388,14 +1388,14 @@ delete_related_insns (rtx insn) peephole insn that will replace them. */ void -delete_for_peephole (rtx from, rtx to) +delete_for_peephole (rtx_insn *from, rtx_insn *to) { - rtx insn = from; + rtx_insn *insn = from; while (1) { - rtx next = NEXT_INSN (insn); - rtx prev = PREV_INSN (insn); + rtx_insn *next = NEXT_INSN (insn); + rtx_insn *prev = PREV_INSN (insn); if (!NOTE_P (insn)) { diff --git a/gcc/output.h b/gcc/output.h index 2b32601..53d575a 100644 --- a/gcc/output.h +++ b/gcc/output.h @@ -281,7 +281,7 @@ extern void assemble_addr_to_section (rtx, section *); extern int get_pool_size (void); #ifdef HAVE_peephole -extern rtx peephole (rtx); +extern rtx_insn *peephole (rtx); #endif extern void output_shared_constant_pool (void); diff --git a/gcc/rtl.h b/gcc/rtl.h index f28a62a..0ad200e 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -3035,7 +3035,7 @@ extern rtx reversed_comparison (const_rtx, enum machine_mode); extern enum rtx_code reversed_comparison_code (const_rtx, const_rtx); extern enum rtx_code reversed_comparison_code_parts (enum rtx_code, const_rtx, const_rtx, const_rtx); -extern void delete_for_peephole (rtx, rtx); +extern void delete_for_peephole (rtx_insn *, rtx_insn *); extern int condjump_in_parallel_p (const_rtx); /* In emit-rtl.c. */ -- 1.8.5.3