https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59875
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Reduced testcase: ``` void foo1() { char *a[4] = {nullptr, nullptr, nullptr, nullptr}; char **b = &a[4]; while (b!=&a[0]) { b--; if (*b) __builtin_free(*b); } } ``` size: 10-3, last_iteration: 10-3 Loop size: 10 Estimated size after unrolling: 18 Not unrolling loop 3: contains call and code would grow. There is another bug similar to this where we could decrease the cost slightly if we know that a[i] is stored above and might eliminate the branch.