This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, MPX, 2/X] Pointers Checker [8/25] Languages support


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.

Thanks,
Ilya
--
2013-11-19  Ilya Enkovich  <ilya.enkovich@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;
 }
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]