<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hello all,</div><div><br></div><div>Is it valid to dereference a pointer that has undef bits in its offset?<br></div><div><br></div><div>For example,</div><div dir="ltr"><br></div><div dir="ltr"><div dir="ltr">%p = alloca [8 x i8]</div><div dir="ltr">%p2 = gep %p, (undef & 8)</div><div dir="ltr">store 0, %p2</div><div dir="ltr"><br></div><div dir="ltr">undef & 8 is always less than 8, so technically it will store zero to one of the array's elements.<br></div></div><div dir="ltr"><br></div><div dir="ltr"><div dir="ltr">The reason is that I want to improve no-undef analysis by suggesting that a pointer that is passed to load/store is well-defined, by making it raise UB when a pointer with undef bits is given.</div></div><div dir="ltr"><br></div><div dir="ltr">A suggested patch is here: <a href="https://reviews.llvm.org/D87994">https://reviews.llvm.org/D87994</a><br clear="all"><div><br></div><div>I wonder whether there is a case using this to do something that I'm not aware.</div><div><br></div><div>Thanks,</div><div>Juneyoung</div></div></div></div></div></div></div></div></div>