On 09/23/14 08:10, Ilya Enkovich wrote:
Please use fold_convert (size_ptr, build_fold_addr_expr (var)).

Is 'var' always accessed via a size_t effective type?  Watch out
for TBAA issues if not.  (if it is, why is 'var' not of type size_t
or size_t[]?)

var has pointer bounds type.  I have to initialize it by parts and
thus access it as a couple of integers having size of a pointer (I
use integer instead of pointer because non poiner arithmetic is
used).  Size type is not the best for this purpose and therefore I
replace it with pointer_sized_int_node.

So I have accesses of var's parts as integers and accesses of whole
var as bounds.  Should I expect some problems from TBAA here?  How
can I avoid problems with TBAA if any exists?
In general, anytime you access a hunk of memory using two different types, then you run the risk of problems with TBAA. In the case of bounds, we aren't exposing them to usercode, so you just have to worry about the refs/sets that you create.

I think you could create an alias set for the bounds and attach it to every load/store if you aren't type safe for all the loads/stores. That will create a dependency between all the bounds loads/stores, but not with unrelated loads/stores. Alternately ensure all the loads/stores are in alias set 0, but that will likely have performance implications.

Jeff

Reply via email to