On 10/13/2016 12:27 PM, Bernd Schmidt wrote:
On 10/13/2016 12:20 PM, Jakub Jelinek wrote:
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
also not expecting LABEL_DECLs might not bind locally or might not
the current def.
Ok, thanks. Guess I'll be testing the following:
The change below bootstrapped and tested ok on x86_64-linux. Ok to commit?
* varasm.c (default_binds_local_p): Assert we don't have LABEL_DECLs.
--- gcc/varasm.c (revision 240861)
+++ gcc/varasm.c (working copy)
@@ -6867,6 +6873,7 @@ default_binds_local_p_3 (const_tree exp,
/* Static variables are always local. */
if (! TREE_PUBLIC (exp))
+ gcc_assert (TREE_CODE (exp) != LABEL_DECL);
/* With resolution file in hand, take look into resolutions.
We can't just return true for resolved_locally symbols,
@@ -6978,6 +6985,7 @@ decl_binds_to_current_def_p (const_tree
if (!TREE_PUBLIC (decl))
+ gcc_assert (TREE_CODE (decl) != LABEL_DECL);
/* When resolution is available, just use it. */
if (symtab_node *node = symtab_node::get (decl))