https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127673
--- Comment #5 from Hongtao Liu <liuhongt at gcc dot gnu.org> --- > > But with n=17 we would need a trip-count for the loop of 1, but the compiled > code will run the inner loop twice. Not familiar with arm backend, but for gimple side, it looks correct, the loop is executed only once when n is 17. if n is 17, _3 is 1, the n_17 = 17 - 16; n_17 != _3 will be false after 1 iteration, so the loop executed only once and exit? <bb 3> [local count: 105119324]: _1 = n_6(D) + 15; num_iter_7 = _1 >> 4; _27 = (unsigned int) n_6(D); _26 = (unsigned int) num_iter_7; _21 = _26 + 4294967295; _20 = _21 >> 1; _19 = _20 * 16; _23 = _27 + 4294967280; _4 = _23 - _19; _3 = (int) _4; <bb 4> [local count: 955630224]: # n_22 = PHI <n_17(4), n_6(D)(3)> # DEBUG i => NULL # DEBUG n => n_22 # DEBUG BEGIN_STMT _28 = (unsigned int) n_22; p_9 = vctp8q (_28); # DEBUG p => p_9 # DEBUG BEGIN_STMT va_11 = vldrbq_z_u8 (a_10(D), p_9); # DEBUG va => va_11 # DEBUG BEGIN_STMT vb_13 = vldrbq_z_u8 (b_12(D), p_9); # DEBUG vb => vb_13 # DEBUG BEGIN_STMT vc_14 = vaddq_x_u8 (va_11, vb_13, p_9); # DEBUG vc => vc_14 # DEBUG BEGIN_STMT vstrbq_p_u8 (c_15(D), vc_14, p_9); # DEBUG BEGIN_STMT n_17 = n_22 + -16; # DEBUG BEGIN_STMT # DEBUG i => NULL # DEBUG n => n_17 # DEBUG BEGIN_STMT if (_3 != n_17)
