view gcc/testsuite/gcc.dg/vect/bb-slp-pow-1.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children 1830386684a0
line wrap: on
line source

/* { dg-additional-options "-fno-math-errno -fdisable-tree-sincos" } */
/* { dg-require-effective-target vect_float } */

void __attribute__ ((noipa))
f (float *a)
{
  a[0] = a[0] * a[0];
  a[1] = __builtin_powf (a[1], 2);
  a[2] = a[2] * a[2];
  a[3] = __builtin_powf (a[3], 2);
}

float a[4] = { 1, 2, 3, 4 };

int
main (void)
{
  f (a);
  for (int i = 0; i < 4; ++i)
    {
      if (a[i] != (i + 1) * (i + 1))
	__builtin_abort ();
      asm volatile ("" ::: "memory");
    }
  return 0;
}

/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp2" } } */