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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |WAITING
                 CC|                            |rguenth at gcc dot gnu.org
           Keywords|                            |missed-optimization
   Last reconfirmed|                            |2024-10-13

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I'm not sure whether you think the bug is that the compiler doesn't see arr1[i]
is equal to 1 and thus arr2[i] equal to 2 and k equal to 0.  I don't think
that's a very useful bugreport.

For the generic

int data[20];
void f(int * __restrict arr1, int * __restrict arr2)
{
  for(int i = 0; i < 20; i++){
      arr2[i] = 2 * arr1[i];
      int k = arr2[i] % arr1[i];
      data[i] = data[i - k] + 1;
  }
}

the data[i-k] access does not have an affine evolution and thus needs to
be vectorized with gather but the data[i] store might conflict and we do
not yet have support for handling conflicts of gather/scatter at runtime
say via maintaining evaluation by using a variable effective vector length
via masking.

Reply via email to