From patchwork Thu Apr 4 19:49:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Bosscher X-Patchwork-Id: 233930 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 785512C009E for ; Fri, 5 Apr 2013 06:50:21 +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 :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=scmoQ2VdprRwkUiy9G+jGNqohLyScOoF1r72QGeVzx25hV C9W/SmA123raKqESzgb+AIHAiAy15NGSY8/fuslPAlYQuBQqm7gz1ZVy0+h3K57F fUEFVkzSQV5/dUGfNpB17kj77abr1XjEILSrftNz6DvXVvVeCsWV+xF6TME94= 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=/Yyi62CQKRTP8UrryVPCuRFuLJY=; b=h5lfbD5ZCtuPixquokoT LhD0Lcc89vzGaZfZFlD0HnDiWZzk5HUR/VYaHH50KERARxyg5As1kKbDc2zyKzAC YnbxoZFKT+3MEjd+3hRAC3mdCpp3ErF7wy9Wzde2d2GzeKh4iimApBAFh1UTaN07 eqDCTCLNPlnseaVBmZNgjog= Received: (qmail 6582 invoked by alias); 4 Apr 2013 19:50:11 -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 6570 invoked by uid 89); 4 Apr 2013 19:50:11 -0000 X-Spam-SWARE-Status: No, score=-4.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE autolearn=ham version=3.3.1 Received: from mail-ve0-f177.google.com (HELO mail-ve0-f177.google.com) (209.85.128.177) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 04 Apr 2013 19:50:08 +0000 Received: by mail-ve0-f177.google.com with SMTP id jw11so2948641veb.8 for ; Thu, 04 Apr 2013 12:50:06 -0700 (PDT) X-Received: by 10.52.164.166 with SMTP id yr6mr5086367vdb.37.1365105006637; Thu, 04 Apr 2013 12:50:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.58.68.228 with HTTP; Thu, 4 Apr 2013 12:49:26 -0700 (PDT) From: Steven Bosscher Date: Thu, 4 Apr 2013 21:49:26 +0200 Message-ID: Subject: [patch] a few random fixes To: GCC Patches X-Virus-Found: No Hello, Just some things I've had in my tree for a while now, ChangeLog says it all: * bb-reorder.c (fix_crossing_unconditional_branches): Remove a set-but-unused variable. * cgraph.c (cgraph_release_function_body): Clear cfun->cfg to make basic blocks of released function bodies garbage-collectable. * ree.c (find_and_remove_re): Do not call df_finish_pass here. (struct rtl_opt_pass): Add TODO_df_finish. * rtl.def (DEFINE_SUBST, DEFINE_SUBST_ATTR): Add documentation. Bootstrapped&tested on powerpc64-unknown-linux-gnu. OK for trunk? Ciao! Steven * bb-reorder.c (fix_crossing_unconditional_branches): Remove a set-but-unused variable. * cgraph.c (cgraph_release_function_body): Clear cfun->cfg to make basic blocks of released function bodies garbage-collectable. * ree.c (find_and_remove_re): Do not call df_finish_pass here. (struct rtl_opt_pass): Add TODO_df_finish. * rtl.def (DEFINE_SUBST, DEFINE_SUBST_ATTR): Add documentation. Index: bb-reorder.c =================================================================== --- bb-reorder.c (revision 197491) +++ bb-reorder.c (working copy) @@ -1998,14 +1998,12 @@ fix_crossing_unconditional_branches (void) if (JUMP_P (last_insn) && (succ->flags & EDGE_CROSSING)) { - rtx label2; - gcc_assert (!any_condjump_p (last_insn)); /* Make sure the jump is not already an indirect or table jump. */ if (!computed_jump_p (last_insn) - && !tablejump_p (last_insn, &label2, NULL)) + && !tablejump_p (last_insn, NULL, NULL)) { /* We have found a "crossing" unconditional branch. Now we must convert it to an indirect jump. First create Index: cgraph.c =================================================================== --- cgraph.c (revision 197491) +++ cgraph.c (working copy) @@ -1260,7 +1260,10 @@ cgraph_node_remove_callers (struct cgraph_node *no node->callers = NULL; } -/* Release memory used to represent body of function NODE. */ +/* Release memory used to represent body of function NODE. + Use this only for functions that are released before being translated to + target code (i.e. RTL). Functions that are compiled to RTL and beyond + are free'd in final.c via free_after_compilation(). */ void cgraph_release_function_body (struct cgraph_node *node) @@ -1285,6 +1288,7 @@ cgraph_release_function_body (struct cgraph_node * gcc_assert (dom_computed[0] == DOM_NONE); gcc_assert (dom_computed[1] == DOM_NONE); clear_edges (); + cfun->cfg = NULL; } if (cfun->value_histograms) free_histograms (); Index: ree.c =================================================================== --- ree.c (revision 197491) +++ ree.c (working copy) @@ -919,8 +919,6 @@ find_and_remove_re (void) if (dump_file && num_re_opportunities > 0) fprintf (dump_file, "Elimination opportunities = %d realized = %d\n", num_re_opportunities, num_realized); - - df_finish_pass (false); } /* Find and remove redundant extensions. */ @@ -958,7 +956,8 @@ struct rtl_opt_pass pass_ree = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_ggc_collect | - TODO_verify_rtl_sharing, /* todo_flags_finish */ + TODO_df_finish + | TODO_ggc_collect + | TODO_verify_rtl_sharing, /* todo_flags_finish */ } }; Index: rtl.def =================================================================== --- rtl.def (revision 197491) +++ rtl.def (working copy) @@ -1290,8 +1290,41 @@ DEF_RTL_EXPR (ATTR_FLAG, "attr_flag", "s", RTX_EXT true, the second operand will be used as the value of the conditional. */ DEF_RTL_EXPR(COND, "cond", "Ee", RTX_EXTRA) +/* Definition of a pattern substitution meta operation on a DEFINE_EXPAND + or a DEFINE_INSN. Automatically generates new instances of DEFINE_INSNs + that match the substitution pattern. + + Operand: + 0: The name of the substitition template. + 1: Input template to match to see if a substitution is applicable. + 2: A C expression giving an additional condition for the generated + new define_expand or define_insn. + 3: Output tempalate to generate via substitution. + + Within a DEFINE_SUBST template, the meaning of some RTL expressions is + different from their usual interpretation: a MATCH_OPERAND matches any + expression tree with matching machine mode or with VOIDmode. Likewise, + MATCH_OP_DUP and MATCH_DUP match more liberally in a DEFINE_SUBST than + in other RTL expressions. MATCH_OPERATOR matches allc common operators + but also UNSPEC, UNSPEC_VOLATILE, and MATCH_OPERATORS from the input + DEFINE_EXPAND or DEFINE_INSN. */ DEF_RTL_EXPR(DEFINE_SUBST, "define_subst", "sEsE", RTX_EXTRA) + +/* Substitution attribute to apply a DEFINE_SUBST to a pattern. + + Operand: + 0: The name of the subst-attribute. + 1: The name of the DEFINE_SUBST to be applied for this attribute. + 2: String to substitute for the subst-attribute name in the pattern + name, for the case that the DEFINE_SUBST is not applied (i.e. the + unmodified version of the pattern). + 3: String to substitute for the subst-attribute name in the pattern + name, for the case that the DEFINE_SUBST is applied to the patten. + + The use of DEFINE_SUBST and DEFINE_SUBST_ATTR is explained in the + GCC internals manual, under "RTL Templates Transformations". */ DEF_RTL_EXPR(DEFINE_SUBST_ATTR, "define_subst_attr", "ssss", RTX_EXTRA) + #endif /* GENERATOR_FILE */ /*