Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/pr62147.c

raw
1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-options "-O2 -fno-tree-loop-distribute-patterns" } */
3
4 /* Note that it's required to disable loop-distribute-patterns, otherwise the
5 loop will be optimized to memset. */
6
7 /* Expect loop_iv can know the loop is finite so the doloop_optimize
8 can perform the doloop transformation. */
9
10 typedef struct {
11 int l;
12 int b[258];
13 } S;
14
15 void clear (S* s )
16 {
17 int i;
18 int len = s->l + 1;
19
20 for (i = 0; i <= len; i++)
21 s->b[i] = 0;
22 }
23
24 /* { dg-final { scan-assembler {\mbdnz\M} } } */