> > 2015-04-07 Ilya Enkovich <ilya.enkov...@intel.com> > > * tree-chkp.c (chkp_find_const_bounds_var): Remove. > (chkp_make_static_const_bounds): Search existing > symbol by assembler name. Use make_decl_one_only. > > gcc/testsuite/ > > 2015-04-07 Ilya Enkovich <ilya.enkov...@intel.com> > > * gcc.dg/lto/chkp-static-bounds_0.c: New.
OK, thanks! > + if ((snode = symtab_node::get_for_asmname (DECL_ASSEMBLER_NAME (var)))) > + { > + /* We don't allow this symbol usage for non bounds. */ > + gcc_assert (snode->type == SYMTAB_VARIABLE); > + gcc_assert (POINTER_BOUNDS_P (snode->decl)); This probably allows users to trigger ICE by declaring function of conflicting name. What about sorry ("...") message instead? > + return snode->decl; > + } > > - TREE_PUBLIC (var) = 1; > TREE_USED (var) = 1; > TREE_READONLY (var) = 1; > - TREE_STATIC (var) = 1; > TREE_ADDRESSABLE (var) = 0; > DECL_ARTIFICIAL (var) = 1; > DECL_READ_P (var) = 1; > + DECL_INITIAL (var) = targetm.chkp_make_bounds_constant (lb, ub); > + make_decl_one_only (var, DECL_ASSEMBLER_NAME (var)); > /* We may use this symbol during ctors generation in chkp_finish_file > when all symbols are emitted. Force output to avoid undefined > symbols in ctors. */ > - if (!in_lto_p) > - { > - DECL_INITIAL (var) = targetm.chkp_make_bounds_constant (lb, ub); > - DECL_COMDAT (var) = 1; > - varpool_node::get_create (var)->set_comdat_group (DECL_ASSEMBLER_NAME > (var)); > - varpool_node::get_create (var)->force_output = 1; > - } > - else > - DECL_EXTERNAL (var) = 1; > + node = varpool_node::get_create (var); > + node->force_output = 1; > + > varpool_node::finalize_decl (var); > > return var;