On 20 Nov 10:59, Richard Biener wrote: > 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. >
Here it is. Thanks, Ilya -- gcc/ 2013-11-20 Ilya Enkovich <ilya.enkov...@intel.com> * cgraphunit.c: Include tree-chkp.h. (varpool_finalize_decl): Register statically initialized decls in Pointer Bounds Checker. diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 8ab274b..6b6ec55 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -201,6 +201,7 @@ along with GCC; see the file COPYING3. If not see #include "regset.h" /* FIXME: For reg_obstack. */ #include "context.h" #include "pass_manager.h" +#include "tree-chkp.h" /* Queue of cgraph nodes scheduled to be added into cgraph. This is a secondary queue used during optimization to accommodate passes that @@ -830,6 +831,9 @@ varpool_finalize_decl (tree decl) finished. */ if (cgraph_state == CGRAPH_STATE_FINISHED) varpool_assemble_decl (node); + + if (DECL_INITIAL (decl)) + chkp_register_var_initializer (decl); } /* EDGE is an polymorphic call. Mark all possible targets as reachable