<div dir="ltr"><div><div>This is my first try on mailing list. Please correct if I am wrong.<br></div>On compiling this program using clang 3.9.1<br><br>#include <stdio.h><br>#include <stdlib.h><br><br>int main () {<br> int i,j;<br> static int x[4000][4000];<br> for (j = 0; j < 4000; j++) {<br> for (i = 0; i < 4000; i++) {<br> x[j][i] = i + j; }<br> }<br>}<br></div><div>got compiled to <br><br> mov dword ptr [rbp - 4], 0<br> mov dword ptr [rbp - 12], 0<br>.LBB0_1: # =>This Loop Header: Depth=1<br> cmp dword ptr [rbp - 12], 4000<br> jge .LBB0_8<br> mov dword ptr [rbp - 8], 0<br>.LBB0_3: # Parent Loop BB0_1 Depth=1<br> cmp dword ptr [rbp - 8], 4000<br><br></div><div>while gcc 7 gives this <br><br> mov DWORD PTR [rbp-8], 0<br>.L5:<br> cmp DWORD PTR [rbp-8], 3999<br> jg .L2<br> mov DWORD PTR [rbp-4], 0<br>.L4:<br> cmp DWORD PTR [rbp-4], 3999<br> jg .L3<br><br></div><div>I think it should be 3999.<br></div><div><div><div><br>-- <br><div class="gmail_signature"><div dir="ltr"><div>Ashish Kumar Gahlot</div><div>III year, UG</div><div>Govt. Engg. College, Ajmer, India</div></div></div>
</div></div></div></div>