annotate gcc/testsuite/gcc.dg/pr79972.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* PR tree-optimization/79972 */
kono
parents:
diff changeset
2 /* { dg-do compile } */
kono
parents:
diff changeset
3 /* { dg-require-effective-target alloca } */
kono
parents:
diff changeset
4 /* { dg-options "-Walloca -Wvla-larger-than=10000" } */
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 int
kono
parents:
diff changeset
7 f (int dim, int *b, int *c)
kono
parents:
diff changeset
8 {
kono
parents:
diff changeset
9 int newcentroid[3][dim]; /* { dg-warning "unbounded use of variable-length array" } */
kono
parents:
diff changeset
10 int *a = newcentroid[2];
kono
parents:
diff changeset
11 int i, dist = 0;
kono
parents:
diff changeset
12 __builtin_memcpy (newcentroid, c, sizeof (newcentroid));
kono
parents:
diff changeset
13 for (i = 0; i < dim; i++)
kono
parents:
diff changeset
14 dist += (a[i] - b[i]) * (a[i] - b[i]);
kono
parents:
diff changeset
15 return dist;
kono
parents:
diff changeset
16 }