<div class="gmail_quote">On 24 October 2011 12:07, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com">eli.friedman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">On Sat, Oct 22, 2011 at 12:58 PM, Nick Lewycky <<a href="mailto:nicholas@mxc.ca">nicholas@mxc.ca</a>> wrote:<br>
> Author: nicholas<br>
> Date: Sat Oct 22 14:58:20 2011<br>
> New Revision: 142731<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=142731&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=142731&view=rev</a><br>
> Log:<br>
> Make SCEV's brute force analysis stronger in two ways. Firstly, we should be<br>
> able to constant fold load instructions where the argument is a constant.<br>
> Second, we should be able to watch multiple PHI nodes through the loop; this<br>
> patch only supports PHIs in loop headers, more can be done here.<br>
><br>
> With this patch, we now constant evaluate:<br>
>  static const int arr[] = {1, 2, 3, 4, 5};<br>
>  int test() {<br>
>    int sum = 0;<br>
>    for (int i = 0; i < 5; ++i) sum += arr[i];<br>
>    return sum;<br>
>  }<br>
<br>
</div>This commit is causing a miscompile on<br>
gcc.c-torture/execute/20030105-1.c (and possibly a couple other<br>
tests).</blockquote><div><br></div><div>Thanks Eli! Fixed in r142843.</div><div><br></div><div>Nick</div><div> </div></div>