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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
   Target Milestone|8.3                         |7.5
            Summary|[8/9 Regression] wrong-code |[7/8/9 Regression]
                   |with SLP vectorized shift   |wrong-code with SLP
                   |                            |vectorized shift

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Variant that also fails with GCC 7 (no SLP induction support):

int x[1024];
int y[1024];
int z[1024];

void __attribute__((noinline)) foo()
{
  for (int i = 0; i < 512; ++i)
    {
      x[2*i] = x[2*i] << y[2*i];
      x[2*i+1] = x[2*i+1] << y[2*i];
      z[2*i] = y[2*i];
      z[2*i+1] = y[2*i+1];
    }
}

int main()
{
  for (int i = 0; i < 1024; ++i)
    x[i] = i, y[i] = i % 8;
  foo ();
  for (int i = 0; i < 1024; ++i)
    if (x[i] != i << ((i & ~1) % 8))
      __builtin_abort ();
  return 0;
}

Reply via email to