------- Comment #15 from aldot at gcc dot gnu dot org 2006-08-20 13:15 -------
(In reply to comment #13)
> Subject: Re: externally_visible attribute not effective with prior
> declaration
> of symbol.
>
> >
> > 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 am not quite convinced there is necesarily a problem, since from
> frontend point of view all public variables are automatically used, so
> the whole thing matters only for the cgraph code were we start to
> differentiate -fwhole-program mode from non-whole-program...
For publics, i'd agree, but still there are clearly private funcs that have
TREE_USED == 0, like:
../../../src/gcc-4.2/libiberty/regex.c:4445: warning: referenced_var_insert():
'' == 0
Where
4441: static reg_errcode_t
4442: byte_compile_range (unsigned int range_start_char, const char **p_ptr,
4443: const char *pend, RE_TRANSLATE_TYPE translate,
4444: reg_syntax_t syntax, unsigned char *b)
4445: {
Aren't these bugs since they clearly are not public and TREE_USED is 0 when
referenced_vars_insert is called on them?
Why are public funcs not marked USED?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28744