aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr102139.c
blob: 06c1357438aad1c8785eb1340374ebda9e748839 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* { dg-do run } */
/* { dg-additional-options "-ftree-slp-vectorize" } */

typedef double aligned_double __attribute__((aligned(2*sizeof(double))));

void __attribute__((noipa))
bar (int aligned, double *p)
{
  if (aligned)
    {
      *(aligned_double *)p = 3.;
      p[1] = 4.;
    }
  else
    {
      p[2] = 0.;
      p[3] = 1.;
    }
}

void __attribute__((noipa))
foo (int i)
{
  if (i)
    __builtin_exit (0);
}
void __attribute__((noipa))
baz (double *p)
{
  p[0] = 0.;
  p[1] = 1.;
  foo (1);
  *(aligned_double *)p = 3.;
  p[1] = 4.;
}

double x[8] __attribute__((aligned(2*sizeof (double))));
int main()
{
  bar (0, &x[1]);
  baz (&x[1]);
  return 0;
}