[llvm-dev] RFC: Resolving TBAA issues
Ivan A. Kosarev via llvm-dev
llvm-dev at lists.llvm.org
Sat Aug 19 13:04:39 PDT 2017
Daniel,
>> the type of (*x) is not compatible with the type of (*b) or,
>> recursively, type of b->i. Similarly, the type of (*b) is not
>> compatible with (*x) or, recursively, x->i.
...
> I think these are interesting interpretations. I'm not sure
> i'd personally agree with them (and there are definitely
> compilers out there that do not).
I wonder how you know that those compilers interpret it differently. If
the correct answer for a specific case is "no alias", then reloading of
values does not say anything about how authors interpret the cited clause.
It's only omission of reloading that does matter.
> It gets more weird with unions.
Would you mind if we proceed with concrete examples from this point?
>> Consider these two accesses:
>>
>> struct A { int i; };
>> struct B { struct A a; } *b;
>>
>> struct X { int i; } *x;
>>
>> b->a
>> x->i
>
> Do you believe the answer changes if you had struct A *x
> instead of struct X *x?
> If so, why?
So then it reads:
struct A { int i; } *x;
struct B { struct A a; } *b;
b->a
x->i
These two accesses are allowed overlap as the type of b->a is compatible
with the type of (*x).
I should admit I don't see what makes this case special. Can you
elaborate please?
Thanks,
--
More information about the llvm-dev
mailing list