Debian Codegraph @

gcc/testsuite/gcc.dg/vect/vect-early-break_129-pr117140.c

raw
1 /* { dg-do compile } */
2 /* { dg-add-options vect_early_break } */
3 /* { dg-require-effective-target vect_early_break } */
4 /* { dg-require-effective-target vect_int } */
5
6 typedef signed char int8_t;
7 typedef short int int16_t;
8 typedef int int32_t;
9 typedef long long int int64_t;
10 typedef unsigned char uint8_t;
11 typedef short unsigned int uint16_t;
12 typedef unsigned int uint32_t;
13 typedef long long unsigned int uint64_t;
14
15 void __attribute__ ((noinline, noclone))
16 test_1_TYPE1_uint32_t (uint16_t *__restrict f, uint32_t *__restrict d,
17 uint16_t x, uint16_t x2, uint32_t y, int n)
18 {
19 for (int i = 0; i < n; ++i)
20 {
21 f[i * 2 + 0] = x;
22 f[i * 2 + 1] = x2;
23 d[i] = y;
24 }
25 }
26
27 void __attribute__ ((noinline, noclone))
28 test_1_TYPE1_int64_t (int32_t *__restrict f, int64_t *__restrict d, int32_t x,
29 int32_t x2, int64_t y, int n)
30 {
31 for (int i = 0; i < n; ++i)
32 {
33 f[i * 2 + 0] = x;
34 f[i * 2 + 1] = x2;
35 d[i] = y;
36 }
37 }
38
39 int
40 main (void)
41 {
42 // This part is necessary for ice to appear though running it by itself does not trigger an ICE
43 int n_3_TYPE1_uint32_t = 32;
44 uint16_t x_3_uint16_t = 233;
45 uint16_t x2_3_uint16_t = 78;
46 uint32_t y_3_uint32_t = 1234;
47 uint16_t f_3_uint16_t[33 * 2 + 1] = { 0} ;
48 uint32_t d_3_uint32_t[33] = { 0} ;
49 test_1_TYPE1_uint32_t (f_3_uint16_t, d_3_uint32_t, x_3_uint16_t, x2_3_uint16_t, y_3_uint32_t, n_3_TYPE1_uint32_t);
50 for (int i = 0;
51 i < n_3_TYPE1_uint32_t;
52 ++i) {
53 if (f_3_uint16_t[i * 2 + 0] != x_3_uint16_t) __builtin_abort ();
54 if (f_3_uint16_t[i * 2 + 1] != x2_3_uint16_t) __builtin_abort ();
55 if (d_3_uint32_t[i] != y_3_uint32_t) __builtin_abort ();
56 }
57 for (int i = n_3_TYPE1_uint32_t;
58 i < n_3_TYPE1_uint32_t + 1;
59 ++i) {
60 if (f_3_uint16_t[i * 2 + 0] != 0) __builtin_abort ();
61 if (f_3_uint16_t[i * 2 + 1] != 0) __builtin_abort ();
62 if (d_3_uint32_t[i] != 0) __builtin_abort ();
63 }
64 // If ran without the above section, a different ice appears. see below
65 int n_3_TYPE1_int64_t = 32;
66 int32_t x_3_int32_t = 233;
67 int32_t x2_3_int32_t = 78;
68 int64_t y_3_int64_t = 1234;
69 int32_t f_3_int32_t[33 * 2 + 1] = { 0 };
70 int64_t d_3_int64_t[33] = { 0 };
71 test_1_TYPE1_int64_t (f_3_int32_t, d_3_int64_t, x_3_int32_t, x2_3_int32_t,
72 y_3_int64_t, n_3_TYPE1_int64_t);
73 for (int i = 0; i < n_3_TYPE1_int64_t; ++i)
74 {
75 if (f_3_int32_t[i * 2 + 0] != x_3_int32_t)
76 __builtin_abort ();
77 if (f_3_int32_t[i * 2 + 1] != x2_3_int32_t)
78 __builtin_abort ();
79 if (d_3_int64_t[i] != y_3_int64_t)
80 __builtin_abort ();
81 }
82
83 for (int i = n_3_TYPE1_int64_t; i < n_3_TYPE1_int64_t + 1; ++i)
84 {
85 if (f_3_int32_t[i * 2 + 0] != 0)
86 __builtin_abort ();
87 if (f_3_int32_t[i * 2 + 1] != 0)
88 __builtin_abort ();
89 if (d_3_int64_t[i] != 0)
90 __builtin_abort ();
91 }
92
93 return 0;
94 }