Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/vect/vect-alias-check-4.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
1 /* { dg-do compile } */ | 1 /* { dg-do compile } */ |
2 /* { dg-require-effective-target vect_int } */ | 2 /* { dg-require-effective-target vect_int } */ |
3 /* { dg-additional-options "--param vect-max-version-for-alias-checks=0" } */ | 3 /* { dg-additional-options "--param vect-max-version-for-alias-checks=0 -fopt-info-vec-all" } */ |
4 | 4 |
5 #define N 16 | 5 #define N 16 |
6 | 6 |
7 struct s1 { int a[N]; }; | 7 struct s1 { int a[N]; }; |
8 struct s2 { struct s1 b; int c; }; | 8 struct s2 { struct s1 b; int c; }; |
10 union u { struct s2 f; struct s3 g; }; | 10 union u { struct s2 f; struct s3 g; }; |
11 | 11 |
12 /* We allow a and b to overlap arbitrarily. */ | 12 /* We allow a and b to overlap arbitrarily. */ |
13 | 13 |
14 void | 14 void |
15 f1 (int a[][N], int b[][N]) | 15 f1 (int a[][N], int b[][N]) /* { dg-message "vectorized 0 loops in function" } */ |
16 { | 16 { |
17 for (int i = 0; i < N; ++i) | 17 for (int i = 0; i < N; ++i) /* { dg-missed "couldn't vectorize loop" } */ |
18 a[0][i] += b[0][i]; | 18 a[0][i] += b[0][i]; |
19 /* { dg-message "will not create alias checks, as --param vect-max-version-for-alias-checks == 0" "" { target *-*-* } .-2 } */ | |
19 } | 20 } |
20 | 21 |
21 void | 22 void |
22 f2 (union u *a, union u *b) | 23 f2 (union u *a, union u *b) /* { dg-message "vectorized 0 loops in function" } */ |
23 { | 24 { |
24 for (int i = 0; i < N; ++i) | 25 for (int i = 0; i < N; ++i) /* { dg-missed "couldn't vectorize loop" } */ |
25 a->f.b.a[i] += b->g.e.a[i]; | 26 a->f.b.a[i] += b->g.e.a[i]; |
27 /* { dg-message "will not create alias checks, as --param vect-max-version-for-alias-checks == 0" "" { target *-*-* } .-2 } */ | |
26 } | 28 } |
27 | 29 |
28 void | 30 void |
29 f3 (struct s1 *a, struct s1 *b) | 31 f3 (struct s1 *a, struct s1 *b) /* { dg-message "vectorized 0 loops in function" } */ |
30 { | 32 { |
31 for (int i = 0; i < N - 1; ++i) | 33 for (int i = 0; i < N - 1; ++i) /* { dg-missed "couldn't vectorize loop" } */ |
32 a->a[i + 1] += b->a[i]; | 34 a->a[i + 1] += b->a[i]; /* { dg-missed "possible dependence between data-refs" } */ |
33 } | 35 } |
34 | 36 |
35 /* { dg-final { scan-tree-dump-not "LOOP VECTORIZED" "vect" } } */ | 37 /* { dg-final { scan-tree-dump-not "LOOP VECTORIZED" "vect" } } */ |