annotate gcc/testsuite/c-c++-common/pr44832.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* PR debug/44832 */
kono
parents:
diff changeset
2 /* { dg-do compile } */
kono
parents:
diff changeset
3 /* { dg-options "-O2 -fcompare-debug" } */
kono
parents:
diff changeset
4 /* { dg-options "-O2 -fcompare-debug -fno-short-enums" {target short_enums} } */
kono
parents:
diff changeset
5 /* { dg-require-effective-target int32plus } */
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 struct rtx_def;
kono
parents:
diff changeset
8 typedef struct rtx_def *rtx;
kono
parents:
diff changeset
9 typedef const struct rtx_def *const_rtx;
kono
parents:
diff changeset
10 struct rtvec_def;
kono
parents:
diff changeset
11 typedef struct rtvec_def *rtvec;
kono
parents:
diff changeset
12 extern int ix86_isa_flags;
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 enum machine_mode
kono
parents:
diff changeset
15 {
kono
parents:
diff changeset
16 VOIDmode,
kono
parents:
diff changeset
17 V8HImode,
kono
parents:
diff changeset
18 V16QImode,
kono
parents:
diff changeset
19 V4SImode,
kono
parents:
diff changeset
20 V2DImode,
kono
parents:
diff changeset
21 V32QImode,
kono
parents:
diff changeset
22 MAX_MACHINE_MODE,
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 NUM_MACHINE_MODES = MAX_MACHINE_MODE
kono
parents:
diff changeset
25 };
kono
parents:
diff changeset
26 extern unsigned char mode_size[NUM_MACHINE_MODES];
kono
parents:
diff changeset
27 extern const unsigned char mode_inner[NUM_MACHINE_MODES];
kono
parents:
diff changeset
28 extern const unsigned char mode_nunits[NUM_MACHINE_MODES];
kono
parents:
diff changeset
29 enum rtx_code {
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 CONST_INT ,
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 CONST_FIXED ,
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 CONST_DOUBLE
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 };
kono
parents:
diff changeset
38 union rtunion_def
kono
parents:
diff changeset
39 {
kono
parents:
diff changeset
40 rtvec rt_rtvec;
kono
parents:
diff changeset
41 };
kono
parents:
diff changeset
42 typedef union rtunion_def rtunion;
kono
parents:
diff changeset
43 struct rtx_def {
kono
parents:
diff changeset
44
kono
parents:
diff changeset
45 __extension__ enum rtx_code code: 16;
kono
parents:
diff changeset
46
kono
parents:
diff changeset
47 __extension__ enum machine_mode mode : 8;
kono
parents:
diff changeset
48
kono
parents:
diff changeset
49 union u {
kono
parents:
diff changeset
50 rtunion fld[1];
kono
parents:
diff changeset
51 } u;
kono
parents:
diff changeset
52 };
kono
parents:
diff changeset
53 struct rtvec_def {
kono
parents:
diff changeset
54 rtx elem[1];
kono
parents:
diff changeset
55 };
kono
parents:
diff changeset
56 extern int rtx_equal_p (const_rtx, const_rtx);
kono
parents:
diff changeset
57 extern rtx gen_reg_rtx (enum machine_mode);
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 extern void
kono
parents:
diff changeset
60 ix86_expand_vector_init_concat (enum machine_mode mode,
kono
parents:
diff changeset
61 rtx target, rtx *ops, int n);
kono
parents:
diff changeset
62
kono
parents:
diff changeset
63 static void
kono
parents:
diff changeset
64 ix86_expand_vector_init_general (unsigned char mmx_ok, enum machine_mode mode,
kono
parents:
diff changeset
65 rtx target, rtx vals)
kono
parents:
diff changeset
66 {
kono
parents:
diff changeset
67 rtx ops[32], op0, op1;
kono
parents:
diff changeset
68 enum machine_mode half_mode = VOIDmode;
kono
parents:
diff changeset
69 int n, i;
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 switch (mode)
kono
parents:
diff changeset
72 {
kono
parents:
diff changeset
73 case V4SImode:
kono
parents:
diff changeset
74 case V2DImode:
kono
parents:
diff changeset
75 n = mode_nunits[mode];
kono
parents:
diff changeset
76 ix86_expand_vector_init_concat (mode, target, ops, n);
kono
parents:
diff changeset
77 return;
kono
parents:
diff changeset
78
kono
parents:
diff changeset
79 case V32QImode:
kono
parents:
diff changeset
80 goto half;
kono
parents:
diff changeset
81 half:
kono
parents:
diff changeset
82 {
kono
parents:
diff changeset
83 typedef int eger;
kono
parents:
diff changeset
84 if (mode != V4SImode)
kono
parents:
diff changeset
85 ops[0] = 0;
kono
parents:
diff changeset
86 }
kono
parents:
diff changeset
87 n = mode_nunits[mode];
kono
parents:
diff changeset
88 for (i = 0; i < n; i++)
kono
parents:
diff changeset
89 ops[i] = (((((vals)->u.fld[0]).rt_rtvec))->elem[i]);
kono
parents:
diff changeset
90 op0 = gen_reg_rtx (VOIDmode);
kono
parents:
diff changeset
91 return;
kono
parents:
diff changeset
92
kono
parents:
diff changeset
93 case V16QImode:
kono
parents:
diff changeset
94 if (!((ix86_isa_flags & (1 << 19)) != 0))
kono
parents:
diff changeset
95 break;
kono
parents:
diff changeset
96
kono
parents:
diff changeset
97 case V8HImode:
kono
parents:
diff changeset
98 if (!((ix86_isa_flags & (1 << 17)) != 0))
kono
parents:
diff changeset
99 break;
kono
parents:
diff changeset
100
kono
parents:
diff changeset
101 n = mode_nunits[mode];
kono
parents:
diff changeset
102 for (i = 0; i < n; i++)
kono
parents:
diff changeset
103 ops[i] = (((((vals)->u.fld[0]).rt_rtvec))->elem[i]);
kono
parents:
diff changeset
104 return;
kono
parents:
diff changeset
105
kono
parents:
diff changeset
106 default:
kono
parents:
diff changeset
107 ;
kono
parents:
diff changeset
108 }
kono
parents:
diff changeset
109
kono
parents:
diff changeset
110 {
kono
parents:
diff changeset
111 int n_words;
kono
parents:
diff changeset
112
kono
parents:
diff changeset
113 n_words = ((unsigned short) mode_size[mode]) / 4;
kono
parents:
diff changeset
114
kono
parents:
diff changeset
115 if (n_words == 4)
kono
parents:
diff changeset
116 ix86_expand_vector_init_general (0, V4SImode, 0, 0);
kono
parents:
diff changeset
117 }
kono
parents:
diff changeset
118 }
kono
parents:
diff changeset
119
kono
parents:
diff changeset
120
kono
parents:
diff changeset
121 void
kono
parents:
diff changeset
122 ix86_expand_vector_init (unsigned char mmx_ok, rtx target, rtx vals)
kono
parents:
diff changeset
123 {
kono
parents:
diff changeset
124 enum machine_mode mode = ((enum machine_mode) (target)->mode);
kono
parents:
diff changeset
125 enum machine_mode inner_mode = ((enum machine_mode) mode_inner[mode]);
kono
parents:
diff changeset
126 int n_elts = mode_nunits[mode];
kono
parents:
diff changeset
127 int n_var = 0, one_var = -1;
kono
parents:
diff changeset
128 unsigned char all_same = 1, all_const_zero = 1;
kono
parents:
diff changeset
129 int i;
kono
parents:
diff changeset
130 rtx x;
kono
parents:
diff changeset
131
kono
parents:
diff changeset
132 for (i = 0; i < n_elts; ++i)
kono
parents:
diff changeset
133 {
kono
parents:
diff changeset
134 x = (((((vals)->u.fld[0]).rt_rtvec))->elem[i]);
kono
parents:
diff changeset
135 if (!((((enum rtx_code) (x)->code) == CONST_INT)
kono
parents:
diff changeset
136 || ((enum rtx_code) (x)->code) == CONST_DOUBLE
kono
parents:
diff changeset
137 || ((enum rtx_code) (x)->code) == CONST_FIXED))
kono
parents:
diff changeset
138 n_var++, one_var = i;
kono
parents:
diff changeset
139 else
kono
parents:
diff changeset
140 all_const_zero = 0;
kono
parents:
diff changeset
141 if (i > 0 && !rtx_equal_p (x, (((((vals)->u.fld[0]).rt_rtvec))->elem[0])))
kono
parents:
diff changeset
142 all_same = 0;
kono
parents:
diff changeset
143 }
kono
parents:
diff changeset
144
kono
parents:
diff changeset
145
kono
parents:
diff changeset
146 if (n_var == 0)
kono
parents:
diff changeset
147 {
kono
parents:
diff changeset
148 return;
kono
parents:
diff changeset
149 }
kono
parents:
diff changeset
150
kono
parents:
diff changeset
151 if (all_same)
kono
parents:
diff changeset
152 return;
kono
parents:
diff changeset
153
kono
parents:
diff changeset
154 if (n_var == 1)
kono
parents:
diff changeset
155 {
kono
parents:
diff changeset
156 if (all_const_zero)
kono
parents:
diff changeset
157 return;
kono
parents:
diff changeset
158
kono
parents:
diff changeset
159 }
kono
parents:
diff changeset
160
kono
parents:
diff changeset
161 ix86_expand_vector_init_general (mmx_ok, mode, target, vals);
kono
parents:
diff changeset
162 }