https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111154

--- Comment #3 from Tomas Chang <changyp6 at gmail dot com> ---
(In reply to Richard Biener from comment #2)
> Confirmed.  Reproduces with -O3 -march=armv8.3-a and
> 
> unsigned char desta[8];
> void copya(unsigned char *src, int size)
> {
>   for (int i = 0; i < size; i++)
>     desta[i] = src[i];
> }
> 
> we end up with a peeled epilogue:
> 
>   if (_12 == niters_vector_mult_vf.6_39)
>     goto <bb 26>; [12.50%]
>   else
>     goto <bb 6>; [87.50%]
> 
>   <bb 6> [local count: 73583527]:
>   _96 = MEM[(unsigned char *)src_8(D) + 8B];
>   desta[_36] = _96;
>   if (size_7(D) > 9)
>     goto <bb 7>; [85.71%]
>   else
>     goto <bb 27>; [14.29%]
> 
>   <bb 27> [local count: 10511932]:
>   goto <bb 21>; [100.00%]
> 
>   <bb 7> [local count: 63071596]:
>   _103 = MEM[(unsigned char *)src_8(D) + 9B];
>   desta[9] = _103;
>   if (size_7(D) != 10)
>     goto <bb 8>; [85.71%]
>   else
>     goto <bb 28>; [14.29%]
> 
>   <bb 28> [local count: 9010228]:
>   goto <bb 21>; [100.00%]
> 
>   <bb 8> [local count: 54061368]:
>   _110 = MEM[(unsigned char *)src_8(D) + 10B];
>   desta[10] = _110;
>   if (size_7(D) != 11)
>     goto <bb 9>; [85.71%]
>   else
>     goto <bb 29>; [14.29%]
> ...

Thanks for confirming this bug so quickly!
Does this issue affect the actually generated code ?

Are there any clues about how to fix this issue ?
If there are patches that can fix, I can help test the patch.

Reply via email to