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
bind to
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.
	(decl_binds_to_current_def_p): Likewise.

Index: gcc/varasm.c
--- 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))
     return true;
+  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
     return false;
   if (!TREE_PUBLIC (decl))
     return true;
+  gcc_assert (TREE_CODE (decl) != LABEL_DECL);
   /* When resolution is available, just use it.  */
   if (symtab_node *node = symtab_node::get (decl))

Reply via email to