From patchwork Sat May 11 19:29:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Bosscher X-Patchwork-Id: 243149 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 137F82C00D0 for ; Sun, 12 May 2013 05:30:44 +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 :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=wC9fJSLFooYCgrUCCM+ap5vmddH1lDwVv5JT9t7xC3RTDi yMr1JlJhwTtZU73sa/76SmK0OwZw+untFHXM4RGalonQ7UhrjCFNDVWjs09HcB7W SXT1Q4A61r6bc2gvrjirCrDIByCHR6EpP1sJFr/rTpuy5VHeG5lsezlywyjV0= 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 :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=kY8pWTKgrgerEs46D6OFCExLA58=; b=vnjz0hsPmIiOcSFiu5DJ xpHt+X9ujININcb+4b5sZEa4eUiO5uqLg9fcrh1ZbQkL7md4vcNusPGrfbghZ6Aw kEtuAP2suI94kB64SEvIKfTO/MyCEDq12Gg7FpFvmsa165GZJnZ/70SD8p/6L/Tq 8/pENQmOis8I8MzIbbvPlr8= Received: (qmail 4327 invoked by alias); 11 May 2013 19:30:36 -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 4315 invoked by uid 89); 11 May 2013 19:30:36 -0000 X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, SPF_PASS autolearn=ham version=3.3.1 Received: from mail-vb0-f47.google.com (HELO mail-vb0-f47.google.com) (209.85.212.47) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sat, 11 May 2013 19:30:35 +0000 Received: by mail-vb0-f47.google.com with SMTP id x14so4235883vbb.6 for ; Sat, 11 May 2013 12:30:33 -0700 (PDT) X-Received: by 10.52.190.130 with SMTP id gq2mr12405911vdc.37.1368300633397; Sat, 11 May 2013 12:30:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.58.50.40 with HTTP; Sat, 11 May 2013 12:29:53 -0700 (PDT) From: Steven Bosscher Date: Sat, 11 May 2013 21:29:53 +0200 Message-ID: Subject: [patch] Small emit-rtl.c / reorg.c cleanup To: GCC Patches Hello, This just removes one unused function, and moves two functions from emit-rtl.c to reorg.c which is the only place where they're used. Will commit in a few days, barring objections. Ciao! Steven * rtl.h (next_label, skip_consecutive_labels, link_cc0_insns): Remove prototypes. * emit-rtl.c (next_label): Remove unused function. (skip_consecutive_labels, link_cc0_insns): Move to ... * reorg.c (skip_consecutive_labels, link_cc0_insns): ... here, the only place where these functions are used. Index: rtl.h =================================================================== --- rtl.h (revision 198737) +++ rtl.h (working copy) @@ -1912,8 +1912,6 @@ extern rtx next_real_insn (rtx); extern rtx prev_active_insn (rtx); extern rtx next_active_insn (rtx); extern int active_insn_p (const_rtx); -extern rtx next_label (rtx); -extern rtx skip_consecutive_labels (rtx); extern rtx next_cc0_user (rtx); extern rtx prev_cc0_setter (rtx); @@ -2551,7 +2549,6 @@ extern unsigned int unshare_all_rtl (void); extern void unshare_all_rtl_again (rtx); extern void unshare_all_rtl_in_chain (rtx); extern void verify_rtl_sharing (void); -extern void link_cc0_insns (rtx); extern void add_insn (rtx); extern void add_insn_before (rtx, rtx, basic_block); extern void add_insn_after (rtx, rtx, basic_block); Index: emit-rtl.c =================================================================== --- emit-rtl.c (revision 198737) +++ emit-rtl.c (working copy) @@ -3332,56 +3332,8 @@ prev_active_insn (rtx insn) return insn; } - -/* Return the next CODE_LABEL after the insn INSN, or 0 if there is none. */ - -rtx -next_label (rtx insn) -{ - while (insn) - { - insn = NEXT_INSN (insn); - if (insn == 0 || LABEL_P (insn)) - break; - } - - return insn; -} - -/* Return the last label to mark the same position as LABEL. Return LABEL - itself if it is null or any return rtx. */ - -rtx -skip_consecutive_labels (rtx label) -{ - rtx insn; - - if (label && ANY_RETURN_P (label)) - return label; - - for (insn = label; insn != 0 && !INSN_P (insn); insn = NEXT_INSN (insn)) - if (LABEL_P (insn)) - label = insn; - - return label; -} ^L #ifdef HAVE_cc0 -/* INSN uses CC0 and is being moved into a delay slot. Set up REG_CC_SETTER - and REG_CC_USER notes so we can find it. */ - -void -link_cc0_insns (rtx insn) -{ - rtx user = next_nonnote_insn (insn); - - if (NONJUMP_INSN_P (user) && GET_CODE (PATTERN (user)) == SEQUENCE) - user = XVECEXP (PATTERN (user), 0, 0); - - add_reg_note (user, REG_CC_SETTER, insn); - add_reg_note (insn, REG_CC_USER, user); -} - /* Return the next insn that uses CC0 after INSN, which is assumed to set it. This is the inverse of prev_cc0_setter (i.e., prev_cc0_setter applied to the result of this function should yield INSN). Index: reorg.c =================================================================== --- reorg.c (revision 198737) +++ reorg.c (working copy) @@ -134,6 +134,44 @@ along with GCC; see the file COPYING3. If not see #define eligible_for_annul_false(INSN, SLOTS, TRIAL, FLAGS) 0 #endif +^L +/* First, some functions that were used before GCC got a control flow graph. + These functions are now only used here in reorg.c, and have therefore + been moved here to avoid inadvertent misuse elsewhere in the compiler. */ + +/* Return the last label to mark the same position as LABEL. Return LABEL + itself if it is null or any return rtx. */ + +rtx +skip_consecutive_labels (rtx label) +{ + rtx insn; + + if (label && ANY_RETURN_P (label)) + return label; + + for (insn = label; insn != 0 && !INSN_P (insn); insn = NEXT_INSN (insn)) + if (LABEL_P (insn)) + label = insn; + + return label; +} + +/* INSN uses CC0 and is being moved into a delay slot. Set up REG_CC_SETTER + and REG_CC_USER notes so we can find it. */ + +void +link_cc0_insns (rtx insn) +{ + rtx user = next_nonnote_insn (insn); + + if (NONJUMP_INSN_P (user) && GET_CODE (PATTERN (user)) == SEQUENCE) + user = XVECEXP (PATTERN (user), 0, 0); + + add_reg_note (user, REG_CC_SETTER, insn); + add_reg_note (insn, REG_CC_USER, user); +} +^L /* Insns which have delay slots that have not yet been filled. */ static struct obstack unfilled_slots_obstack;