https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64396
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- The reason is GCC tries to be smart of calculating s4 outside of the loop because the iv that might be selected is not related at all to s4. That is it might do: int limit = es4-s4; int i = 0; for(i=0;i<limit;i++) { add_carry32(sum, *s4[i]); }