Debian Codegraph @

gcc/testsuite/gcc.dg/vect/pr112774.c

raw
1 /* PR tree-optimization/112774 */
2 /* { dg-do compile } */
3 /* { dg-require-effective-target vect_int } */
4 /* { dg-additional-options "-O2 -ftree-vectorize" } */
5
6 int A[1024 * 2];
7
8 int foo (unsigned offset, unsigned N)
9 {
10 int sum = 0;
11
12 for (unsigned i = 0; i < N; i++)
13 sum += A[i + offset];
14
15 return sum;
16 }
17
18 /* Loop can be vectorized by referring "i + offset" is nonwrapping from array. */
19 /* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { target { ! { avr-*-* msp430-*-* pru-*-* } } } } } */