annotate gcc/testsuite/gcc.dg/vect/aligned-section-anchors-vect-70.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 /* { dg-do compile } */
kono
parents:
diff changeset
2 /* { dg-require-effective-target section_anchors } */
kono
parents:
diff changeset
3 /* { dg-require-effective-target vect_int } */
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 #define N 32
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 /* Increase alignment of struct if an array's offset is multiple of alignment of
kono
parents:
diff changeset
8 vector type corresponding to it's scalar type.
kono
parents:
diff changeset
9 For the below test-case:
kono
parents:
diff changeset
10 offsetof(e) == 8 bytes.
kono
parents:
diff changeset
11 i) For arm: let x = alignment of vector type corresponding to int,
kono
parents:
diff changeset
12 x == 8 bytes.
kono
parents:
diff changeset
13 Since offsetof(e) % x == 0, set DECL_ALIGN(a, b, c) to x.
kono
parents:
diff changeset
14 ii) For aarch64, ppc: x == 16 bytes.
kono
parents:
diff changeset
15 Since offsetof(e) % x != 0, don't increase alignment of a, b, c.
kono
parents:
diff changeset
16 */
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 static struct A {
kono
parents:
diff changeset
19 int p1, p2;
kono
parents:
diff changeset
20 int e[N];
kono
parents:
diff changeset
21 } a, b, c;
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 int foo(void)
kono
parents:
diff changeset
24 {
kono
parents:
diff changeset
25 for (int i = 0; i < N; i++)
kono
parents:
diff changeset
26 a.e[i] = b.e[i] + c.e[i];
kono
parents:
diff changeset
27
kono
parents:
diff changeset
28 return a.e[0];
kono
parents:
diff changeset
29 }
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 /* { dg-final { scan-ipa-dump-times "Increasing alignment of decl" 0 "increase_alignment" { target aarch64*-*-* } } } */
kono
parents:
diff changeset
32 /* { dg-final { scan-ipa-dump-times "Increasing alignment of decl" 0 "increase_alignment" { target powerpc64*-*-* } } } */
kono
parents:
diff changeset
33 /* { dg-final { scan-ipa-dump-times "Increasing alignment of decl" 3 "increase_alignment" { target arm*-*-* } } } */