[Bug tree-optimization/64365] Predictive commoning after loop vectorization produces incorrect code.

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jan 14 12:14:00 GMT 2015


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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
extern void abort (void);
extern int memcmp (const void * , const void *, __SIZE_TYPE__);

void __attribute__((noinline,noclone))
foo(int *in)
{
    for (int i = 14; i >= 10; i--) {
        in[i - 8] -= in[i];
        in[i - 5] += in[i] * 2;
        in[i - 4] += in[i];
    }
}

int main()
{    
  int x[16];
  int y[16] = { 0, 1, -22, -8, -8, 40, 38, 42, 46, 50, 24, 11, 12, 13, 14, 15
};
  int i;

  for (i = 0; i < 16; ++i)
    {
      x[i] = i;
      __asm__ volatile ("");
    }

  foo (x);

  if (memcmp (x, y, sizeof (x)) != 0)
    abort ();

  return 0;
}



More information about the Gcc-bugs mailing list