https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80198
--- Comment #20 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org>
---
(In reply to Richard Biener from comment #19)
> So I think when you consider
>
> void __attribute__((noinline)) fun(int * a, int * b, int c)
> {
> int i;
> for (i=0; i < 256; i++) {
> a[i] = b[i] | c;
> }
> }
>
> we can improve the versioning condition to allow a dependence distance
> of zero.
This one was fixed by r10-4803. E.g. for aarch64 we now have:
add x3, x1, 4
sub x3, x0, x3
cmp x3, 8
bls .L5
> Likewise with
>
> void __attribute__((noipa)) generic(int * a, int * b, int c)
> {
> int i;
> a = __builtin_assume_aligned (a, 16);
> b = __builtin_assume_aligned (b, 16);
> for (i=0; i < 256; i++) {
> a[i] = b[i] | c;
> }
> }
>
> we fail to realize no versioning check is required - the distance is
> either zero or a multiple of 16.
>
> Richard - ISTR you added some alignment considerations to the alias
> versioning code, but it doesn't seem to help?
I don't remember adding anything for that, but yeah, I agree it looks
like we need it.