This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, Pointer Bounds Checker 24/x] PRE
- From: Ilya Enkovich <enkovich dot gnu at gmail dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 18 Aug 2014 17:02:09 +0400
- Subject: Re: [PATCH, Pointer Bounds Checker 24/x] PRE
- Authentication-results: sourceware.org; auth=none
- References: <20140603071327 dot GB20877 at msticlxl57 dot ims dot intel dot com> <CAFiYyc2OE8hPLoLkYJwz6pxQKWWA=dvq8-HqNWxZjeAXWQigAg at mail dot gmail dot com>
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.
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..743bc0e 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 : 10;
+ /* 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;