https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127673
--- Comment #4 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
The test that is now failing has
/* Iteration counter counting up to num_iter, with a larger increment */
void test4 (uint8_t *a, uint8_t *b, uint8_t *c, int n)
{
int num_iter = (n + 15)/16;
for (int i = 0; i < num_iter; i+=2)
{
mve_pred16_t p = vctp8q (n);
uint8x16_t va = vldrbq_z_u8 (a, p);
uint8x16_t vb = vldrbq_z_u8 (b, p);
uint8x16_t vc = vaddq_x_u8 (va, vb, p);
vstrbq_p_u8 (c, vc, p);
n -= 16;
}
}
Which is now compiled to:
test4:
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 0, uses_anonymous_args = 0
cmp r3, #0
ble .L43
push {lr}
dlstp.8 lr, r3
.L40:
vldrb.8 q3, [r0]
vldrb.8 q2, [r1]
vadd.i8 q3, q3, q2
vstrb.8 q3, [r2]
letp lr, .L40
pop {pc}
.L43:
bx lr
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.