search for: enough_bytes

Displaying 4 results from an estimated 4 matches for "enough_bytes".

2013 Mar 13
0
[LLVMdev] PROPOSAL: struct-access-path aware TBAA
...> }; > > with struct-access-path aware TBAA, C::b1.a.x does not alias with D::c.b2.a.x. > without it, the 2 scalar accesses can alias since both have int type. I browsed the 2012 standard for a while and I didn't see anything that would make this illegal: char *p = malloc(enough_bytes); intptr_t x = reinterpret_cast<intptr_t>(p); x += offsetof(C, b2); D &vd = *reinterpret_cast<D*>(p); C &vc = *reinterpret_cast<C*>(x); vd.c.b2.a.x = 1; // ..accessing the same int t = vc.b1.a.x; // ..storage I don't think that the path through the type structure...
2013 Mar 12
3
[LLVMdev] PROPOSAL: struct-access-path aware TBAA
On Mar 12, 2013, at 8:22 AM, Krzysztof Parzyszek wrote: > What cases does this proposal solve that the current analyses don't? Do you have a motivating example? Given struct A { int x; int y; }; struct B { A a; int z; }; struct C { B b1; B b2; }; struct D { C c; }; with struct-access-path aware TBAA, C::b1.a.x does not alias with D::c.b2.a.x.
2013 Mar 13
3
[LLVMdev] PROPOSAL: struct-access-path aware TBAA
...uct-access-path aware TBAA, C::b1.a.x does not alias with > D::c.b2.a.x. > > without it, the 2 scalar accesses can alias since both have int type. > > I browsed the 2012 standard for a while and I didn't see anything that > would make this illegal: > > char *p = malloc(enough_bytes); > intptr_t x = reinterpret_cast<intptr_t>(p); > x += offsetof(C, b2); > D &vd = *reinterpret_cast<D*>(p); > C &vc = *reinterpret_cast<C*>(x); > vd.c.b2.a.x = 1; // ..accessing the same > int t = vc.b1.a.x; // ..storage > > I don't think th...
2013 Mar 13
2
[LLVMdev] PROPOSAL: struct-access-path aware TBAA
...ct-access-path aware TBAA, C::b1.a.x does not alias with >> D::c.b2.a.x. >> without it, the 2 scalar accesses can alias since both have int type. > > I browsed the 2012 standard for a while and I didn't see anything that would > make this illegal: > > char *p = malloc(enough_bytes); > intptr_t x = reinterpret_cast<intptr_t>(p); > x += offsetof(C, b2); > D &vd = *reinterpret_cast<D*>(p); > C &vc = *reinterpret_cast<C*>(x); > vd.c.b2.a.x = 1; // ..accessing the same > int t = vc.b1.a.x; // ..storage > > I don't think th...