From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30796 invoked by alias); 13 Oct 2014 21:13:47 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 30781 invoked by uid 89); 13 Oct 2014 21:13:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_STOCKGEN,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-ig0-f174.google.com Received: from mail-ig0-f174.google.com (HELO mail-ig0-f174.google.com) (209.85.213.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 13 Oct 2014 21:13:45 +0000 Received: by mail-ig0-f174.google.com with SMTP id a13so12110130igq.1 for ; Mon, 13 Oct 2014 14:13:43 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.50.83.97 with SMTP id p1mr2095994igy.19.1413234823550; Mon, 13 Oct 2014 14:13:43 -0700 (PDT) Received: by 10.64.225.193 with HTTP; Mon, 13 Oct 2014 14:13:43 -0700 (PDT) In-Reply-To: <543C3E94.10305@redhat.com> References: <20141008185708.GC13454@msticlxl57.ims.intel.com> <543C3E94.10305@redhat.com> Date: Mon, 13 Oct 2014 21:15:00 -0000 Message-ID: Subject: Re: [PATCH, Pointer Bounds Checker 14/x] Passes [3/n] Helper functions From: Ilya Enkovich To: Jeff Law Cc: gcc-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg01198.txt.bz2 2014-10-14 1:05 GMT+04:00 Jeff Law : > On 10/08/14 12:57, Ilya Enkovich wrote: >> >> Hi, >> >> This patch introduces helper functions used by instrumentation. These >> helpers are used to access local structures, generate typical expressions, >> vars and statements. I also included local data initializer into this >> patch. >> >> Thanks, >> Ilya >> -- >> 2014-10-08 Ilya Enkovich >> >> * tree-chkp.c (assign_handler): New. >> (chkp_get_zero_bounds): New. >> (chkp_uintptr_type): New. >> (chkp_none_bounds_var): New. >> (entry_block): New. >> (zero_bounds): New. >> (none_bounds): New. >> (incomplete_bounds): New. >> (tmp_var): New. >> (size_tmp_var): New. >> (chkp_abnormal_copies): New. >> (chkp_invalid_bounds): New. >> (chkp_completed_bounds_set): New. >> (chkp_reg_bounds): New. >> (chkp_bound_vars): New. >> (chkp_reg_addr_bounds): New. >> (chkp_incomplete_bounds_map): New. >> (chkp_static_var_bounds): New. >> (in_chkp_pass): New. >> (CHKP_BOUND_TMP_NAME): New. >> (CHKP_SIZE_TMP_NAME): New. >> (CHKP_BOUNDS_OF_SYMBOL_PREFIX): New. >> (CHKP_STRING_BOUNDS_PREFIX): New. >> (CHKP_VAR_BOUNDS_PREFIX): New. >> (CHKP_NONE_BOUNDS_VAR_NAME): New. >> (chkp_get_tmp_var): New. >> (chkp_get_tmp_reg): New. >> (chkp_get_size_tmp_var): New. >> (chkp_register_addr_bounds): New. >> (chkp_get_registered_addr_bounds): New. >> (chkp_mark_completed_bounds): New. >> (chkp_completed_bounds): New. >> (chkp_erase_completed_bounds): New. >> (chkp_register_incomplete_bounds): New. >> (chkp_incomplete_bounds): New. >> (chkp_erase_incomplete_bounds): New. >> (chkp_mark_invalid_bounds): New. >> (chkp_valid_bounds): New. >> (chkp_mark_invalid_bounds_walker): New. >> (chkp_build_addr_expr): New. >> (chkp_get_entry_block): New. >> (chkp_get_bounds_var): New. >> (chkp_get_registered_bounds): New. >> (chkp_check_lower): New. >> (chkp_check_upper): New. >> (chkp_check_mem_access): New. >> (chkp_build_component_ref): New. >> (chkp_build_array_ref): New. >> (chkp_can_be_shared): New. >> (chkp_make_bounds): New. >> (chkp_get_none_bounds_var): New. >> (chkp_get_zero_bounds): New. >> (chkp_get_none_bounds): New. >> (chkp_get_invalid_op_bounds): New. >> (chkp_get_nonpointer_load_bounds): New. >> (chkp_get_next_bounds_parm): New. >> (chkp_build_bndldx): New. >> (chkp_make_static_bounds): New. >> (chkp_generate_extern_var_bounds): New. >> (chkp_intersect_bounds): New. >> (chkp_may_narrow_to_field): New. >> (chkp_narrow_bounds_for_field): New. >> (chkp_narrow_bounds_to_field): New. >> (chkp_walk_pointer_assignments): New. >> (chkp_init): New. >> >> >> diff --git a/gcc/tree-chkp.c b/gcc/tree-chkp.c >> index 4ab8de6..c65334c 100644 >> --- a/gcc/tree-chkp.c >> +++ b/gcc/tree-chkp.c > > >> + fprintf (dump_file, "Regsitered bound "); > > s/Regsitered/Registered/ > > Where does chkp_can_be_shared get used? Normally the thing to do would > just be to call unshare_expr. It'll create copies as needed. If it's > something that is supposed to be shared then it'll leave it alone. If you > need to do something different than unshare_expr, then that needs deeper > investigation as you're mucking around in the structure sharing assumptions > and that's not to be done lightly. All its uses are like following: if (!chkp_can_be_shared (rhs1)) rhs1 = unshare_expr (rhs1); If unshare_expr avoids copies by itself then this check is useless and I should remove all its uses. Thanks, Ilya > > jeff > >