diff mbox

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

Message ID 20131120134942.GB53216@msticlxl57.ims.intel.com
State New
Headers show

Commit Message

Ilya Enkovich Nov. 20, 2013, 1:49 p.m. UTC
On 20 Nov 10:59, Richard Biener wrote:
> On Tue, Nov 19, 2013 at 9:29 PM, Ilya Enkovich <enkovich.gnu@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.enkovich@intel.com>

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

Comments

Jeff Law Nov. 20, 2013, 7:05 p.m. UTC | #1
On 11/20/13 06:49, Ilya Enkovich wrote:
> On 20 Nov 10:59, Richard Biener wrote:
>> On Tue, Nov 19, 2013 at 9:29 PM, Ilya Enkovich <enkovich.gnu@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.enkovich@intel.com>
>
> 	* cgraphunit.c: Include tree-chkp.h.
> 	(varpool_finalize_decl): Register statically
> 	initialized decls in Pointer Bounds Checker.
This is fine.  Note Richi's request to postpone this feature means this 
can't go in until the next stage1.  However, at that time, the approved 
hunks can be updated for the trunk and go in.  Ideally we'll have all 
the hunks reviewed and ready to go before then -- though once the 
current stage1 closes, everyone will be much more focused on bugfixing.

jeff
diff mbox

Patch

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