------- Comment #11 from hubicka at ucw dot cz 2006-08-20 12:42 ------- 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. 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