This is the mail archive of the 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 14/x] Passes [11/n] Optimization helpers

On 10/10/14 08:24, Ilya Enkovich wrote:
On 09 Oct 12:09, Jeff Law wrote:
On 10/08/14 13:16, Ilya Enkovich wrote:

This patch introduces structures and manipulation functions used by simple checker optimizations.  Structures are used to hold checks information - type of check and checked address in a polinomial form.

2014-10-08  Ilya Enkovich  <>

	* tree-chkp.c (check_type): New.
	(pol_item): New.
	(address_t): New.
	(check_info): New.
	(bb_checks): New.
	(chkp_pol_item_compare): New.
	(chkp_pol_find): New.
	(chkp_extend_const): New.
	(chkp_add_addr_item): New.
	(chkp_sub_addr_item): New.
	(chkp_add_addr_addr): New.
	(chkp_sub_addr_addr): New.
	(chkp_mult_addr): New.
	(chkp_is_constant_addr): New.
	(chkp_print_addr): New.
	(chkp_collect_addr_value): New.
	(chkp_collect_value): New.
	(chkp_fill_check_info): New.

+/* Find plynomial item in ADDR with var equal to VAR

With nit fixed and functions moved into whatever new file gets
created for the optimization work  this will be OK.

Thanks for review!  Here is a fixed version.

2014-10-10  Ilya Enkovich  <>

	* tree-chkp-opt.c: New.
	* (OBJS): Add tree-chkp-opt.o.

diff --git a/gcc/ b/gcc/
index d8c8488..cd45b29 100644
--- a/gcc/
+++ b/gcc/
@@ -1389,6 +1389,7 @@ OBJS = \
  	tree-parloops.o \
  	tree-phinodes.o \
  	tree-chkp.o \
+	tree-chkp-opt.o \
  	tree-predcom.o \
  	tree-pretty-print.o \
  	tree-profile.o \
diff --git a/gcc/tree-chkp-opt.c b/gcc/tree-chkp-opt.c
new file mode 100644
index 0000000..103c4bb
--- /dev/null
+++ b/gcc/tree-chkp-opt.c
@@ -0,0 +1,463 @@
+/* Pointer Bounds Checker optimization pass.
+   Copyright (C) 2014 Free Software Foundation, Inc.
+   Contributed by Ilya Enkovich (
+This file is part of GCC.
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<>.  */
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tree-core.h"
+#include "stor-layout.h"
+#include "varasm.h"
+#include "tree.h"
+#include "target.h"
+#include "tree-iterator.h"
+#include "tree-cfg.h"
+#include "langhooks.h"
+#include "tree-pass.h"
+#include "hashtab.h"
+#include "diagnostic.h"
+#include "ggc.h"
+#include "output.h"
+#include "internal-fn.h"
+#include "is-a.h"
+#include "predict.h"
+#include "cfgloop.h"
+#include "stringpool.h"
+#include "tree-ssa-alias.h"
+#include "tree-ssanames.h"
+#include "tree-ssa-operands.h"
+#include "tree-ssa-address.h"
+#include "tree-ssa.h"
+#include "ipa-inline.h"
+#include "basic-block.h"
+#include "tree-ssa-loop-niter.h"
+#include "gimple-expr.h"
+#include "gimple.h"
+#include "tree-phinodes.h"
+#include "gimple-ssa.h"
+#include "ssa-iterators.h"
+#include "gimple-pretty-print.h"
+#include "gimple-iterator.h"
+#include "gimplify.h"
+#include "gimplify-me.h"
+#include "print-tree.h"
+#include "expr.h"
+#include "tree-ssa-propagate.h"
+#include "gimple-fold.h"
+#include "gimple-walk.h"
+#include "tree-dfa.h"
+#include "tree-chkp.h"
Thanks.  Looks good.

As a follow-up, can you try to trim down what appear to be the over-zealous includes? It's a minor thing, but we are trying to be a bit saner about that kind of stuff than we've been in the past.

If you've already done that, then, well, we've clearly still got a ways to go. For example, I can't see why you'd need output.h here :-0


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