[Bug c/28744] externally_visible attribute not effective with prior declaration of symbol.

jakub at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Aug 17 12:20:00 GMT 2006



------- Comment #9 from jakub at gcc dot gnu dot org  2006-08-17 12:20 -------
The problem mentioned in #7 is not specific to variables, foo.c:
extern int foo (void);

__attribute__((externally_visible)) void *bar(void)
{
  return foo;
}
bar.c:
__attribute__((externally_visible)) int foo (void)
{
}

results in foo not being externally visible in the end.
The problem seems to be on the process_function_and_variable_attributes side,
it only analyzes newly added cgraph_nodes and cgraph_varpool_nodes.  But, if a
prior TU already created such nodes (just DECL_EXTERNALs), then even if they
were defined in the current TU, process_function_and_variable_attributes won't
see them as new.
Always walking the whole pools might be too expensive on the other side.
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?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28744



More information about the Gcc-bugs mailing list