aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/pr62147.c
blob: 635c73711da153fedd6f83e14f012dffc6e31593 (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
/* { dg-do compile { target { powerpc*-*-* } } } */
/* { dg-options "-O2 -fno-tree-loop-distribute-patterns" } */

/* Note that it's required to disable loop-distribute-patterns, otherwise the
   loop will be optimized to memset.  */

/* Expect loop_iv can know the loop is finite so the doloop_optimize
   can perform the doloop transformation.  */

typedef struct {
  int l;
  int b[258];
} S;

void clear (S* s )
{
  int i;
  int len = s->l + 1;

  for (i = 0; i <= len; i++)
    s->b[i] = 0;
}

/* { dg-final { scan-assembler {\mbdnz\M} } } */