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, Pointer Bounds Checker 24/x] PRE


On 03 Sep 13:25, Jeff Law wrote:
> On 08/18/14 07:02, Ilya Enkovich wrote:
> >On 03 Jun 11:33, Richard Biener wrote:
> >>On Tue, Jun 3, 2014 at 9:13 AM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote:
> >>>Hi,
> >>>
> >>>This patch preserves CALL_WITH_BOUNDS flag for calls during PRE.
> >>
> >>Ok.
> >>
> >>Richard.
> >>
> >
> >Merging with the trunk I found that op2 field of vn_reference_op_struct is now used to pass EH context for calls and there is no more free field to store with_bounds flag.  So I added one.  Does it look OK?
> >
> >
> >Thanks,
> >Ilya
> >--
> >2014-08-14  Ilya Enkovich  <ilya.enkovich@intel.com>
> >
> >	* tree-ssa-sccvn.h (vn_reference_op_struct): Transform opcode
> >	into bit field and add with_bounds field.
> >	* tree-ssa-sccvn.c (copy_reference_ops_from_call): Set
> >	with_bounds field for instrumented calls.
> >	* tree-ssa-pre.c (create_component_ref_by_pieces_1): Restore
> >	CALL_WITH_BOUNDS_P flag for calls.
> For consistency, make the bitfield 16 bits (see ipa-inline.h,
> tree-core.h and tree-ssa-sccvn.h.
> 
> OK with that change.
> 
> jeff
> 

Thanks for your comments!  Below is a fixed version.

Ilya
--

2014-09-15  Ilya Enkovich  <ilya.enkovich@intel.com>

	* tree-ssa-sccvn.h (vn_reference_op_struct): Transform opcode
	into bit field and add with_bounds field.
	* tree-ssa-sccvn.c (copy_reference_ops_from_call): Set
	with_bounds field for instrumented calls.
	* tree-ssa-pre.c (create_component_ref_by_pieces_1): Restore
	CALL_WITH_BOUNDS_P flag for calls.


diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index 8b4d2ba..8d286c9 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -2581,6 +2581,8 @@ create_component_ref_by_pieces_1 (basic_block block, vn_reference_t ref,
 				   (TREE_CODE (fn) == FUNCTION_DECL
 				    ? build_fold_addr_expr (fn) : fn),
 				   nargs, args);
+	if (currop->with_bounds)
+	  CALL_WITH_BOUNDS_P (folded) = true;
 	free (args);
 	if (sc)
 	  CALL_EXPR_STATIC_CHAIN (folded) = sc;
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index ec0bf6b..c6f749d 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -1149,6 +1149,8 @@ copy_reference_ops_from_call (gimple call,
   if (stmt_could_throw_p (call) && (lr = lookup_stmt_eh_lp (call)) > 0)
     temp.op2 = size_int (lr);
   temp.off = -1;
+  if (gimple_call_with_bounds_p (call))
+    temp.with_bounds = 1;
   result->safe_push (temp);
 
   /* Copy the call arguments.  As they can be references as well,
diff --git a/gcc/tree-ssa-sccvn.h b/gcc/tree-ssa-sccvn.h
index 84ea278..5608e3a 100644
--- a/gcc/tree-ssa-sccvn.h
+++ b/gcc/tree-ssa-sccvn.h
@@ -80,7 +80,9 @@ typedef const struct vn_phi_s *const_vn_phi_t;
 
 typedef struct vn_reference_op_struct
 {
-  enum tree_code opcode;
+  ENUM_BITFIELD(tree_code) opcode : 16;
+  /* 1 for instrumented calls.  */
+  unsigned with_bounds : 1;
   /* Constant offset this op adds or -1 if it is variable.  */
   HOST_WIDE_INT off;
   tree type;


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