From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 885 invoked by alias); 20 Aug 2006 12:53:29 -0000 Received: (qmail 778 invoked by uid 48); 20 Aug 2006 12:53:18 -0000 Date: Sun, 20 Aug 2006 12:53:00 -0000 Message-ID: <20060820125318.777.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c/28744] externally_visible attribute not effective with prior declaration of symbol. In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "aldot at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-08/txt/msg01595.txt.bz2 List-Id: ------- Comment #12 from aldot at gcc dot gnu dot org 2006-08-20 12:53 ------- (In reply to comment #11) > Subject: Re: externally_visible attribute not effective with prior declaration > of symbol. > > > Is there any reason why process_function_and_variable_attributes is called > > at the end of each TU rather than when all TUs were already parsed? > > The reason is that we do unreachable function removal after each unit > (to conserve memory) and for that we do need to process USED attributes > (not really the externally_visible as those are used only in > cgraph_optimize). Keeping handling of USED attributes at TU basis, > while moving externally_visible to global basis would not completely > work, since USED attributes in whole program mode can be used for public > variables too, pretty much as externally_visible is used in the > testcase. If this is really true, then there are several bugs (in the FEs?) because there are numerous occurances where referenced_vars_insert() is called with TREE_USED(to) == 0 Should there be an assertion that only TREE_USED() > 0 are valid targets for insertion in/after dfa? > > I guess only solution is to process all TU local objects at the end of > each TU and all global objects at the cgraph_optimize stage. I will > post the patch for this. > > Thank you for looking into those dead ends! > Honza > -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28744