From patchwork Wed Jun 5 15:32:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 249117 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 060FE2C09CB for ; Thu, 6 Jun 2013 01:32:48 +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:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=KSVR8O1bGm5fCmDYc Pu1s4ByChP/T24oUixhI89H7OjqcCwNOZcKdrNz7y69/VSGs2qnwAFrhVSuV/wl1 0X+uJYKIRjmNRAe6gKUs2YQI9J1XUGVZREB2ie8BtzA9n7Q1btr7biU8ywNey+60 Z4tfyTMALIxs+Dr4xbqNZPApgI= 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:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=default; bh=/q/uF305wJivr4VRnTVLIQK Fx0M=; b=xkeYQPILAECQaj1vr0Fk1weTFu5iIysRjCZ7EWq/sFPFVbtAfBaacc0 21m11zzdjsZh8UhhLjkGN8fyDSu0odojcSbczKVSAi9zwXzrB8c0S5hX5EFvSTxU Pfpy7FvxBRPG6EjKq90Zz825D7PI7tHx3Rz75om/vuoU3HVhY7XE= Received: (qmail 31353 invoked by alias); 5 Jun 2013 15:32:41 -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 31309 invoked by uid 89); 5 Jun 2013 15:32:34 -0000 X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL, BAYES_50, KAM_STOCKGEN, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD autolearn=no version=3.3.1 Received: from atrey.karlin.mff.cuni.cz (HELO atrey.karlin.mff.cuni.cz) (195.113.26.193) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 05 Jun 2013 15:32:33 +0000 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 4018) id 5019E815C1; Wed, 5 Jun 2013 17:32:31 +0200 (CEST) Date: Wed, 5 Jun 2013 17:32:31 +0200 From: Jan Hubicka To: David Edelsohn Cc: Jan Hubicka , GCC Patches Subject: Re: Symtab cleanups 4/17 Message-ID: <20130605153231.GB8018@atrey.karlin.mff.cuni.cz> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) > Honza, > > Also, you did not remove the declaration of mark_decl_referenced() in tree.h Sorry for the breakage. It was change in final version of patch where I noticed that mark_decl_referenced is dead and I did not get into idea that targets may use it. Looking at the use cases, I think it may be completely removed or replaced by DECL_PRESERVE_P as you do, but I will try to do this case by case. For this reason I just commited patch reverting removal of this function. Index: ChangeLog =================================================================== --- ChangeLog (revision 199698) +++ ChangeLog (working copy) @@ -1,3 +1,8 @@ +2013-06-05 Jan Hubicka + + * varasm.c (mark_decl_referenced): Revert the removal until targets + are fixed. + 2013-06-05 David Edelsohn * config/rs6000/rs6000.c (print_operand, 'z'): Use DECL_PRESERVE_P Index: varasm.c =================================================================== --- varasm.c (revision 199698) +++ varasm.c (working copy) @@ -2244,6 +2244,33 @@ mark_referenced (tree id) TREE_SYMBOL_REFERENCED (id) = 1; } +/* Set the symbol_referenced flag for DECL and notify callgraph. */ +void +mark_decl_referenced (tree decl) +{ + if (TREE_CODE (decl) == FUNCTION_DECL) + { + /* Extern inline functions don't become needed when referenced. + If we know a method will be emitted in other TU and no new + functions can be marked reachable, just use the external + definition. */ + struct cgraph_node *node = cgraph_get_create_node (decl); + if (!DECL_EXTERNAL (decl) + && !node->symbol.definition) + cgraph_mark_force_output_node (node); + } + else if (TREE_CODE (decl) == VAR_DECL) + { + struct varpool_node *node = varpool_node_for_decl (decl); + /* C++ frontend use mark_decl_references to force COMDAT variables + to be output that might appear dead otherwise. */ + node->symbol.force_output = true; + } + /* else do nothing - we can get various sorts of CST nodes here, + which do not need to be marked. */ +} + + /* Follow the IDENTIFIER_TRANSPARENT_ALIAS chain starting at *ALIAS until we find an identifier that is not itself a transparent alias. Modify the alias passed to it by reference (and all aliases on the