Displaying 2 results from an estimated 2 matches for "cigix".
Did you mean:
cidir
2020 Jul 09
2
Understand alias-analysis results
Hello,
I am performing alias analysis toward the following simple code:
struct MyStruct {
int * f1;
int * f2;
};
void NOALIAS(void* p, void* q){
}
int main() {
struct MyStruct s[2];
int a,b;
s[0].f1 = &a;
s[1].f1 = &b;
NOALIAS(s[a].f1, s[b].f2);
return 0;
}
When I use the following command to generate .bc code and conduct alias
analysis:
clang -c -emit-llvm t.c -O2
opt -basicaa
2020 Jul 09
2
Understand alias-analysis results
...are
> uninitialized--consequently, attempting to access `s[a].f1` and
> `s[b].f2` is undefined behavior (as we're using automatic storage
> duration objects `a` and `b` while their values are indeterminate):
> https://taas.trust-in-soft.com/tsnippet/t/acff56c8
>
> Cf. https://cigix.me/c17#6.7.9.p10 ("If an object that has automatic
> storage duration is not initialized explicitly, its value is
> indeterminate.") & https://cigix.me/c17#J.2.p1
> ("The behavior is undefined in the following circumstances: [...] The
> value of an object with automat...