diff mbox

[Pointer,Bounds,Checker,16/x] Register statically initialized pointers

Message ID 20140530130059.GB45878@msticlxl57.ims.intel.com
State New
Headers show

Commit Message

Ilya Enkovich May 30, 2014, 1 p.m. UTC
Hi,

This patchs registers all statically initialized vars in Pointer Bounds Checker. It allows to build proper Bounds Tables for statically initialized pointers.

Bootstrapped and tested on linux-x86_64.

Thanks,
Ilya
--
gcc/

2014-05-30  Ilya Enkovich  <ilya.enkovich@intel.com>

	* cgraphunit.c: Include tree-chkp.h.
	(varpool_finalize_decl): Register statically
	initialized decls in Pointer Bounds Checker.

Comments

Jeff Law May 30, 2014, 4:18 p.m. UTC | #1
On 05/30/14 07:00, Ilya Enkovich wrote:
> Hi,
>
> This patchs registers all statically initialized vars in Pointer Bounds Checker. It allows to build proper Bounds Tables for statically initialized pointers.
>
> Bootstrapped and tested on linux-x86_64.
>
> Thanks,
> Ilya
> --
> gcc/
>
> 2014-05-30  Ilya Enkovich  <ilya.enkovich@intel.com>
>
> 	* cgraphunit.c: Include tree-chkp.h.
> 	(varpool_finalize_decl): Register statically
> 	initialized decls in Pointer Bounds Checker.
This is fine for the trunk when all the other bounds checker stuff is 
approved.

jeff
diff mbox

Patch

diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index ceb4060..c5c3333 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -210,6 +210,7 @@  along with GCC; see the file COPYING3.  If not see
 #include "pass_manager.h"
 #include "tree-nested.h"
 #include "gimplify.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
@@ -839,6 +840,9 @@  varpool_finalize_decl (tree decl)
   if (cgraph_state == CGRAPH_STATE_FINISHED
       || (!flag_toplevel_reorder && cgraph_state == CGRAPH_STATE_EXPANSION))
     varpool_assemble_decl (node);
+
+  if (DECL_INITIAL (decl))
+    chkp_register_var_initializer (decl);
 }
 
 /* EDGE is an polymorphic call.  Mark all possible targets as reachable