<html><head></head><body><div dir="auto">um... you are right... Thank you very much for good comment! :)</div>
<div class="gmail_quote" >On 14 Jun 2018, at 00:17, "Friedman, Eli" <<a href="mailto:efriedma@codeaurora.org" target="_blank">efriedma@codeaurora.org</a>> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="blue">On 6/13/2018 3:50 PM, JinGu wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> Let's slightly change the example as below.<br><br> char subbuf1[2];<br> char subbuf2[2];<br> char subbuf3[2];<br> char subbuf4[2];<br> char *buf[4] = {subbuf1, subbuf2, subbuf3, subbuf4};<br> char c;<br> void test(int idx) {<br>   char *a = buf[3 - idx];<br>   char *b = buf[idx];<br>   *a = *b;<br>   c++;<br>   *a = *b;<br> }<br><br> I think we can say the 'buf' does not point 'c'.<br></blockquote><br>That doesn't help... the compiler still can't prove whether some other <br>translation unit modifies buf.<br><br>If you declare buf as `char *const buf[4] = {subbuf1, subbuf2, subbuf3, <br>subbuf4};`, then I guess you could prove that the pointers in buf don't <br>point to c.  But that's a rare pattern in practice, and it would be kind <br>of expensive to analyze in BasicAA.  Maybe if we add stateful AA to LLVM <br>eventually.<br><br>-Eli<br></pre></blockquote></div></body></html>