aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr96522.c
blob: 2f55d1aeb4d5e58aa8db59503031ba4e5fc0616f (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
/* { dg-do run } */
/* { dg-additional-options "-fno-tree-pta" } */

__attribute__((noipa)) void
bar (void)
{
  volatile int v = 1;
  if (v)
    __builtin_abort ();
}

__attribute__((noipa)) void
baz (void)
{
}

__attribute__((noipa)) void
foo (int n, double *p, double *x)
{
  if (n < 10 && p != 0)
    for (int i = 0; i < 10; i++)
      if (x[0] < p[i])
        x[i] = 0;
  if (p != 0)
    bar ();
  else
    baz ();
}

int
main ()
{
  double arr[10];
  foo (1000, 0, arr);
  return 0;
}