On Tue, Nov 19, 2013 at 9:29 PM, Ilya Enkovich <enkovich....@gmail.com> wrote: > On 19 Nov 12:33, Jeff Law wrote: >> On 11/19/13 05:13, Ilya Enkovich wrote: >> >On 19 Nov 13:00, Richard Biener wrote: >> >>I'd say not in the gimplifier either but in varpool (symbol table) code >> >>where the symbols are ultimatively registered with? >> > >> >Something like that? >> > >> >--- a/gcc/varpool.c >> >+++ b/gcc/varpool.c >> >@@ -151,6 +151,10 @@ varpool_node_for_decl (tree decl) >> > node = varpool_create_empty_node (); >> > node->decl = decl; >> > symtab_register_node (node); >> >+ >> >+ if (DECL_NIITIAL (decl)) >> >+ chkp_register_var_initializer (decl); >> >+ >> > return node; >> > } >> Yea, I think that's what Richi is suggesting. >> jeff >> > > Great! Here is a full version of the patch. Bootstrap, make check and MPX > tests are OK with the change.
Please don't do this in varpool_node_for_decl but in varpool_finalize_decl. Richard. > Thanks, > Ilya > -- > 2013-11-19 Ilya Enkovich <ilya.enkov...@intel.com> > > * varpool.c: Include tree-chkp.h. > (varpool_node_for_decl): Register statically > initialized decls in Pointer Bounds Checker. > > > diff --git a/gcc/varpool.c b/gcc/varpool.c > index 471db82..8487b6e 100644 > --- a/gcc/varpool.c > +++ b/gcc/varpool.c > @@ -34,6 +34,7 @@ along with GCC; see the file COPYING3. If not see > #include "output.h" > #include "gimple.h" > #include "flags.h" > +#include "tree-chkp.h" > > /* List of hooks triggered on varpool_node events. */ > struct varpool_node_hook_list { > @@ -151,6 +152,10 @@ varpool_node_for_decl (tree decl) > node = varpool_create_empty_node (); > node->decl = decl; > symtab_register_node (node); > + > + if (DECL_INITIAL (decl)) > + chkp_register_var_initializer (decl); > + > return node; > } >