2014-10-14 1:05 GMT+04:00 Jeff Law <l...@redhat.com>:
> 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  <ilya.enkov...@intel.com>
>>
>>         * 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
>
>

Reply via email to