comparison gcc/testsuite/gcc.dg/vect/vect-93.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
2 /* { dg-additional-options "--param vect-max-peeling-for-alignment=0" } */ 2 /* { dg-additional-options "--param vect-max-peeling-for-alignment=0" } */
3 3
4 #include <stdarg.h> 4 #include <stdarg.h>
5 #include "tree-vect.h" 5 #include "tree-vect.h"
6 6
7 #define N 3001 7 #define N1 3001
8 8
9 #if VECTOR_BITS > 256
10 #define N2 (VECTOR_BITS / 32 + 2)
11 #else
12 #define N2 10
13 #endif
9 14
10 __attribute__ ((noinline)) int 15 __attribute__ ((noinline)) int
11 main1 (float *pa) 16 main1 (float *pa)
12 { 17 {
13 int i; 18 int i;
14 19
15 for (i = 0; i < 3001; i++) 20 for (i = 0; i < N1; i++)
16 { 21 {
17 pa[i] = 2.0; 22 pa[i] = 2.0;
18 } 23 }
19 24
20 /* check results: */ 25 /* check results: */
21 for (i = 0; i < 3001; i++) 26 for (i = 0; i < N1; i++)
22 { 27 {
23 if (pa[i] != 2.0) 28 if (pa[i] != 2.0)
24 abort (); 29 abort ();
25 } 30 }
26 31
27 for (i = 1; i <= 10; i++) 32 for (i = 1; i <= N2; i++)
28 { 33 {
29 pa[i] = 3.0; 34 pa[i] = 3.0;
30 } 35 }
31 36
32 /* check results: */ 37 /* check results: */
33 for (i = 1; i <= 10; i++) 38 for (i = 1; i <= N2; i++)
34 { 39 {
35 if (pa[i] != 3.0) 40 if (pa[i] != 3.0)
36 abort (); 41 abort ();
37 } 42 }
38 43
40 } 45 }
41 46
42 int main (void) 47 int main (void)
43 { 48 {
44 int i; 49 int i;
45 float a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))); 50 float a[N1] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
46 float b[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))); 51 float b[N1] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
47 52
48 check_vect (); 53 check_vect ();
49 54
50 /* from bzip2: */ 55 /* from bzip2: */
51 for (i=0; i<N; i++) b[i] = i; 56 for (i = 0; i < N1; i++)
57 b[i] = i;
52 a[0] = 0; 58 a[0] = 0;
53 for (i = 1; i <= 256; i++) a[i] = b[i-1]; 59 for (i = 1; i <= 256; i++) a[i] = b[i-1];
54 60
55 /* check results: */ 61 /* check results: */
56 for (i = 1; i <= 256; i++) 62 for (i = 1; i <= 256; i++)