On Thu, Oct 13, 2016 at 12:11:36PM +0200, Bernd Schmidt wrote:
> On 10/13/2016 01:25 AM, Jakub Jelinek wrote:
> >Seems 2 functions in varasm.c just use TREE_PUBLIC on LABEL_DECLs together
> >with other kinds of decls, but as TREE_PUBLIC on LABEL_DECLs means now
> >something different, it breaks badly.
> Which functions are these?
The ones I've noticed were:
default_binds_local_p_3 (const_tree exp, bool shlib, bool weak_dominate,
bool extern_protected_data, bool common_local_p)
/* A non-decl is an entry in the constant pool. */
if (!DECL_P (exp))
/* Static variables are always local. */
if (! TREE_PUBLIC (exp))
decl_binds_to_current_def_p (const_tree decl)
gcc_assert (DECL_P (decl));
if (!targetm.binds_local_p (decl))
if (!TREE_PUBLIC (decl))
both relied on TREE_PUBLIC be actually false for LABEL_DECLs, because
otherwise they have code later on that can't handle LABE_DECLs (plus callers
also not expecting LABEL_DECLs might not bind locally or might not bind to
the current def.