annotate gcc/testsuite/gcc.dg/vect/vect-reduc-pattern-1b-big-array.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-require-effective-target vect_int } */
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 #include <stdarg.h>
kono
parents:
diff changeset
4 #include "tree-vect.h"
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 #define N 128
kono
parents:
diff changeset
7 unsigned char udata_ch[N];
kono
parents:
diff changeset
8 #define SUM N*(N-1)
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 __attribute__ ((noinline)) int
kono
parents:
diff changeset
11 foo ()
kono
parents:
diff changeset
12 {
kono
parents:
diff changeset
13 int i;
kono
parents:
diff changeset
14 unsigned int intsum = 0;
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 for (i = 0; i < N; i++)
kono
parents:
diff changeset
17 {
kono
parents:
diff changeset
18 udata_ch[i] = i*2;
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
19 asm volatile ("" ::: "memory");
111
kono
parents:
diff changeset
20 }
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 /* widenning sum: sum chars into int. */
kono
parents:
diff changeset
23 for (i = 0; i < N; i++)
kono
parents:
diff changeset
24 {
kono
parents:
diff changeset
25 intsum += udata_ch[i];
kono
parents:
diff changeset
26 }
kono
parents:
diff changeset
27
kono
parents:
diff changeset
28 /* check results: */
kono
parents:
diff changeset
29 if (intsum != SUM)
kono
parents:
diff changeset
30 abort ();
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 return 0;
kono
parents:
diff changeset
33 }
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 int
kono
parents:
diff changeset
36 main (void)
kono
parents:
diff changeset
37 {
kono
parents:
diff changeset
38 check_vect ();
kono
parents:
diff changeset
39 return foo ();
kono
parents:
diff changeset
40 }
kono
parents:
diff changeset
41
kono
parents:
diff changeset
42 /* { dg-final { scan-tree-dump-times "vect_recog_widen_sum_pattern: detected" 1 "vect" } } */
kono
parents:
diff changeset
43 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_sum_qi_to_si || vect_unpack } } } } */
kono
parents:
diff changeset
44 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { { ! vect_widen_sum_qi_to_si } && { ! vect_unpack } } } } } */