From f7217cde7f382aeb19dd3e80bc8f7ffae798315f Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sat, 20 Sep 2014 01:56:52 +0200 Subject: re PR c++/61825 (g++.dg/cpp0x/static_assert9.C FAILs) PR c++/61825 * c-family/c-common.c (handle_alias_ifunc_attribute): Check that visibility change is possible (handle_weakref_attribute): Likewise. * cgraph.h (symtab_node): Add method get_create and field refuse_visibility_changes. (symtab_node::get_create): New method. * fold-const.c (tree_single_nonzero_warnv_p): Use get_create. * varasm.c (mark_weak): Verify that visibility change is possible. * gcc.dg/tree-ssa/nonzero-1.c: Require error to be output. From-SVN: r215409 --- gcc/cgraph.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'gcc/cgraph.h') diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 030a1c7..a316e40 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -346,6 +346,10 @@ public: return decl->decl_with_vis.symtab_node; } + /* Try to find a symtab node for declaration DECL and if it does not + exist or if it corresponds to an inline clone, create a new one. */ + static inline symtab_node * get_create (tree node); + /* Return the cgraph node that has ASMNAME for its DECL_ASSEMBLER_NAME. Return NULL if there's no such node. */ static symtab_node *get_for_asmname (const_tree asmname); @@ -394,7 +398,9 @@ public: unsigned analyzed : 1; /* Set for write-only variables. */ unsigned writeonly : 1; - + /* Visibility of symbol was used for further optimization; do not + permit further changes. */ + unsigned refuse_visibility_changes : 1; /*** Visibility and linkage flags. ***/ @@ -2519,4 +2525,12 @@ cgraph_node::mark_force_output (void) gcc_checking_assert (!global.inlined_to); } +inline symtab_node * symtab_node::get_create (tree node) +{ + if (TREE_CODE (node) == VAR_DECL) + return varpool_node::get_create (node); + else + return cgraph_node::get_create (node); +} + #endif /* GCC_CGRAPH_H */ -- cgit v1.1