summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr45105.c
blob: a93a21f9ee54d3ccfcbdd9188f8c317a8779b21f (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
/* PR debug/45105 */
/* { dg-do compile } */
/* { dg-options "-Os -fcompare-debug" } */

extern int *baz (int *, int *);

void
bar (int *p1, int *p2)
{
  int n = *baz (0, 0);
  p1[n] = p2[n];
}

void
foo (int *p, int l)
{
  int a1[32];
  int a2[32];
  baz (a1, a2);
  while (l)
    {
      if (l & 1)
	p = baz (a2, p);
      l--;
      bar (a1, a2);
    }
}