<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hello all,<div><br></div><div>LangRef isn't clear about the value of padding when an aggregate value is stored into memory, and I'd like to suggest that storing an aggregate fills padding with undef.</div><div><br></div><div><div>Here are a few clues that supports this change:<br></div><div><br></div><div>- According to C17, the value of padding bytes when storing values in structures or unions is unspecified.</div><div><br></div><div>- IPSCCP ignores padding and directly stores a constant aggregate if possible: <a href="https://godbolt.org/z/ddWq9z">https://godbolt.org/z/ddWq9z</a></div><div>Memcpyopt ignores padding when copying an aggregate or storing a constant: <a href="https://godbolt.org/z/hY6ndd">https://godbolt.org/z/hY6ndd</a> / <a href="https://godbolt.org/z/3WMP5a">https://godbolt.org/z/3WMP5a</a><br></div><div><br></div><div>- Alive2 (with store operation updated) did not find any problematic transformation from LLVM unit tests and while running translation validation on a few C programs.</div><div><br></div><div>The patch is here: <a href="https://reviews.llvm.org/D86189">https://reviews.llvm.org/D86189</a></div><div><br></div><div>Thanks,</div><div>Juneyoung</div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><br></div><font size="1">Juneyoung Lee</font><div><font size="1">Software Foundation Lab, Seoul National University</font></div></div></div></div></div></div></div></div></div></div></div></div></div></div>