aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/pr59523.c
blob: b523eaea8a1516e21e96e62f08756977d9b9b2c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* PR tree-optimization/59523 */
/* { dg-do compile } */
/* { dg-options "-O3" } */
/* { dg-additional-options "-mavx2" { target { i?86-*-* x86_64-*-* } } } */

int *
foo (int a, int *b, int *c, int *d)
{
  int i, *r = __builtin_alloca (a * sizeof (int));
  __builtin_memcpy (r, d, a * sizeof (int));
  for (i = 0; i < 64; i++)
    c[i] += b[i];
  for (i = 0; i < a; i++)
    if (r[i] == 0)
      r[i] = 1;
  return r;
}