1 /* PR tree-optimization/52267 */
2 /* { dg-do run { target { int16 } } } */
3 /* { dg-options "-O2" } */
4 
5 extern void abort (void);
6 
7 #define BITSM1 (sizeof (int) * __CHAR_BIT__ - 1)
8 #define BITSH ((sizeof (int) - sizeof (short)) * __CHAR_BIT__)
9 
10 void
f1(unsigned int s)11 f1 (unsigned int s)
12 {
13   if ((s & (7U << (BITSM1 - 2))) != 0)
14     {
15       if (s == (0xc000U << BITSH) - 1 || s == (0xf000U << BITSH) - 1
16 	  || s == (0x9000U << BITSH) - 1 || s == (0xa031U << BITSH) - 1
17 	  || s == (0xbfbfU << BITSH) || s == (0xc000U << BITSH)
18 	  || s == (0xf000U << BITSH) || s == (0x9000U << BITSH)
19 	  || s == (0xc000U << BITSH) + 1 || s == -1U || s == -15U
20 	  || s == 0x3cbf || s == 0x3cc0
21 	  || s == -15550U || s == -15552U || s == (0x7000 << BITSH) - 1
22 	  || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
23 	  || s == 1U + __INT_MAX__ || s == -32U
24 	  || s == (3 << (BITSM1 - 2)) + 2 || s == -5U || s == -63U
25 	  || s == -64U || s == -65U || s == 6U + __INT_MAX__ || s == -8189U
26 	  || s == -8191U || s == -8192U || s == -8193U || s == -8250U
27 	  || s == -8255U || s == -8256U || s == -8257U || s == __INT_MAX__
28 	  || s == __INT_MAX__ + 9U)
29 	return;
30     }
31   else
32     {
33       if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
34 	  || s == 0x20 || s == 0x3f || s == 1
35 	  || s == (1 << (BITSM1 - 2)) - 1 || s == 2 || s == 24 || s == 5)
36 	return;
37     }
38   abort ();
39 }
40 
41 void
f2(int s)42 f2 (int s)
43 {
44   if ((s & (7U << (BITSM1 - 2))) == 0)
45     {
46       if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
47 	  || s == 0x20 || s == 0x3f || s == 1
48 	  || s == (1 << (BITSM1 - 2)) - 1 || s == 2 || s == 24 || s == 5)
49 	return;
50     }
51   else
52     {
53       if (s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
54 	  || s == (-0x7000 << BITSH) - 1 || s == (-0x5fcf << BITSH) - 1
55 	  || s == (-0x4041 << BITSH) || s == (-0x4000 << BITSH)
56 	  || s == (-0x1000 << BITSH) || s == (-0x7000 << BITSH)
57 	  || s == (-0x4000 << BITSH) + 1 || s == -1 || s == -15 || s == -15550
58 	  || s == 0x3cbf || s == 0x3cc0
59 	  || s == -15552 || s == (0x7000 << BITSH) - 1
60 	  || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
61 	  || s == -__INT_MAX__ - 1 || s == -32 || s == (3 << (BITSM1 - 2)) + 2
62 	  || s == -5 || s == -63 || s == -64 || s == -65
63 	  || s == -__INT_MAX__ + 4 || s == -8189 || s == -8191 || s == -8192
64 	  || s == -8193 || s == -8250 || s == -8255 || s == -8256
65 	  || s == -8257 || s == __INT_MAX__ || s == -__INT_MAX__ + 7)
66 	return;
67     }
68   abort ();
69 }
70 
71 void
f3(unsigned int s)72 f3 (unsigned int s)
73 {
74   if ((s & 0x3cc0) == 0)
75     {
76       if (s == 0 || s == 0x20 || s == 0x3f
77 	  || s == (0xc000U << BITSH)
78 	  || s == (0xc000U << BITSH) + 1 || s == 1
79 	  || s == 1U + __INT_MAX__ || s == 2 || s == 24
80 	  || s == 5 || s == 6U + __INT_MAX__
81 	  || s == __INT_MAX__ + 9U)
82 	return;
83     }
84   else
85     {
86       if (s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
87 	  || s == (0xbfbfU << BITSH) || s == (0xf000U << BITSH)
88 	  || s == (0x9000U << BITSH)
89 	  || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
90 	  || s == (3 << (BITSM1 - 2)) + 2
91 	  || s == 0x3cbf || s == 0x3cc0 || s == (0xc000U << BITSH) - 1
92 	  || s == (0xf000U << BITSH) - 1 || s == (0x9000U << BITSH) - 1
93 	  || s == (0xa031U << BITSH) - 1 || s == -1U || s == -15U
94 	  || s == -15550U || s == -15552U || s == (0x7000 << BITSH) - 1
95 	  || s == (1 << (BITSM1 - 2)) - 1 || s == -32U || s == -5U
96 	  || s == -63U || s == -64U || s == -65U || s == -8189U || s == -8191U
97 	  || s == -8192U || s == -8193U || s == -8250U || s == -8255U
98 	  || s == -8256U || s == -8257U || s == __INT_MAX__)
99 	return;
100     }
101   abort ();
102 }
103 
104 void
f4(int s)105 f4 (int s)
106 {
107   if ((s & 0x3cc0) == 0)
108     {
109       if (s == 0 || s == 0x20 || s == 0x3f
110 	  || s == (-0x4000 << BITSH)
111 	  || s == (-0x4000 << BITSH) + 1 || s == 1
112 	  || s == -__INT_MAX__ - 1 || s == 2 || s == 24
113 	  || s == 5 || s == -__INT_MAX__ + 4
114 	  || s == -__INT_MAX__ + 7)
115 	return;
116     }
117   else
118     {
119       if (s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
120 	  || s == (-0x4041 << BITSH) || s == (-0x1000 << BITSH)
121 	  || s == (-0x7000 << BITSH)
122 	  || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
123 	  || s == (3 << (BITSM1 - 2)) + 2
124 	  || s == 0x3cbf || s == 0x3cc0 || s == (-0x4000 << BITSH) - 1
125 	  || s == (-0x1000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
126 	  || s == (-0x5fcf << BITSH) - 1 || s == -1 || s == -15 || s == -15550
127 	  || s == -15552 || s == (0x7000 << BITSH) - 1
128 	  || s == (1 << (BITSM1 - 2)) - 1 || s == -32 || s == -5 || s == -63
129 	  || s == -64 || s == -65 || s == -8189 || s == -8191 || s == -8192
130 	  || s == -8193 || s == -8250 || s == -8255 || s == -8256
131 	  || s == -8257 || s == __INT_MAX__)
132 	return;
133     }
134   abort ();
135 }
136 
137 void
f5(int s)138 f5 (int s)
139 {
140   if ((s & 0x3cc0U) == 0)
141     {
142       if (s == 0 || s == 0x20 || s == 0x3f
143 	  || s == (-0x4000 << BITSH)
144 	  || s == (-0x4000 << BITSH) + 1 || s == 1
145 	  || s == -__INT_MAX__ - 1 || s == 2 || s == 24
146 	  || s == 5 || s == -__INT_MAX__ + 4
147 	  || s == -__INT_MAX__ + 7)
148 	return;
149     }
150   else
151     {
152       if (s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
153 	  || s == (-0x4041 << BITSH) || s == (-0x1000 << BITSH)
154 	  || s == (-0x7000 << BITSH)
155 	  || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
156 	  || s == (3 << (BITSM1 - 2)) + 2
157 	  || s == 0x3cbf || s == 0x3cc0 || s == (-0x4000 << BITSH) - 1
158 	  || s == (-0x1000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
159 	  || s == (-0x5fcf << BITSH) - 1 || s == -1 || s == -15 || s == -15550
160 	  || s == -15552 || s == (0x7000 << BITSH) - 1
161 	  || s == (1 << (BITSM1 - 2)) - 1 || s == -32 || s == -5 || s == -63
162 	  || s == -64 || s == -65 || s == -8189 || s == -8191 || s == -8192
163 	  || s == -8193 || s == -8250 || s == -8255 || s == -8256
164 	  || s == -8257 || s == __INT_MAX__)
165 	return;
166     }
167   abort ();
168 }
169 
170 void
f6(unsigned int s)171 f6 (unsigned int s)
172 {
173   if ((s & 0x3cc0) == 0x3cc0)
174     {
175       if (s == 0x3cc0 || s == (0xc000U << BITSH) - 1
176 	  || s == -1U || s == -15U
177 	  || s == (1 << (BITSM1 - 2)) - 1
178 	  || s == -32U || s == -5U || s == -63U || s == -64U
179 	  || s == __INT_MAX__)
180 	return;
181     }
182   else
183     {
184       if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
185 	  || s == (0xf000U << BITSH) - 1 || s == (0x9000U << BITSH) - 1
186 	  || s == (0xa031U << BITSH) - 1
187 	  || s == (0x7000 << BITSH) - 1
188 	  || s == 0x20 || s == 0x3cbf || s == 0x3f || s == (0xbfbfU << BITSH)
189 	  || s == (0xc000U << BITSH) || s == (0xf000U << BITSH)
190 	  || s == (0x9000U << BITSH) || s == (0xc000U << BITSH) + 1 || s == 1
191 	  || s == -15550U || s == -15552U || s == (0x7000 << BITSH)
192 	  || s == (1 << (BITSM1 - 2)) || s == 1U + __INT_MAX__ || s == 2
193 	  || s == 24 || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -65U
194 	  || s == 6U + __INT_MAX__ || s == -8189U || s == -8191U
195 	  || s == -8192U || s == -8193U || s == -8250U || s == -8255U
196 	  || s == -8256U || s == -8257U || s == __INT_MAX__ + 9U)
197 	return;
198     }
199   abort ();
200 }
201 
202 void
f7(int s)203 f7 (int s)
204 {
205   if ((s & 0x3cc0) == 0x3cc0)
206     {
207       if (s == 0x3cc0 || s == (-0x4000 << BITSH) - 1
208 	  || s == -1 || s == -15
209 	  || s == (1 << (BITSM1 - 2)) - 1
210 	  || s == -32 || s == -5 || s == -63 || s == -64 || s == __INT_MAX__)
211 	return;
212     }
213   else
214     {
215       if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
216 	  || s == (-0x1000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
217 	  || s == (-0x5fcf << BITSH) - 1
218 	  || s == (0x7000 << BITSH) - 1
219 	  || s == 0x20 || s == 0x3cbf || s == 0x3f || s == (-0x4041 << BITSH)
220 	  || s == (-0x4000 << BITSH) || s == (-0x1000 << BITSH)
221 	  || s == (-0x7000 << BITSH) || s == (-0x4000 << BITSH) + 1 || s == 1
222 	  || s == -15550 || s == -15552 || s == (0x7000 << BITSH)
223 	  || s == (1 << (BITSM1 - 2)) || s == -__INT_MAX__ - 1 || s == 2
224 	  || s == 24 || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -65
225 	  || s == -__INT_MAX__ + 4 || s == -8189 || s == -8191 || s == -8192
226 	  || s == -8193 || s == -8250 || s == -8255 || s == -8256
227 	  || s == -8257 || s == -__INT_MAX__ + 7)
228 	return;
229     }
230   abort ();
231 }
232 
233 void
f8(int s)234 f8 (int s)
235 {
236   if ((s & 0x3cc0U) == 0x3cc0)
237     {
238       if (s == 0x3cc0 || s == (-0x4000 << BITSH) - 1
239 	  || s == -1 || s == -15
240 	  || s == (1 << (BITSM1 - 2)) - 1
241 	  || s == -32 || s == -5 || s == -63 || s == -64 || s == __INT_MAX__)
242 	return;
243     }
244   else
245     {
246       if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
247 	  || s == (-0x1000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
248 	  || s == (-0x5fcf << BITSH) - 1
249 	  || s == (0x7000 << BITSH) - 1
250 	  || s == 0x20 || s == 0x3cbf || s == 0x3f || s == (-0x4041 << BITSH)
251 	  || s == (-0x4000 << BITSH) || s == (-0x1000 << BITSH)
252 	  || s == (-0x7000 << BITSH) || s == (-0x4000 << BITSH) + 1 || s == 1
253 	  || s == -15550 || s == -15552 || s == (0x7000 << BITSH)
254 	  || s == (1 << (BITSM1 - 2)) || s == -__INT_MAX__ - 1 || s == 2
255 	  || s == 24 || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -65
256 	  || s == -__INT_MAX__ + 4 || s == -8189 || s == -8191 || s == -8192
257 	  || s == -8193 || s == -8250 || s == -8255 || s == -8256
258 	  || s == -8257 || s == -__INT_MAX__ + 7)
259 	return;
260     }
261   abort ();
262 }
263 
264 void
f9(unsigned int s)265 f9 (unsigned int s)
266 {
267   if ((s & 0x3cc0) >= 0x1cc0)
268     {
269       if (s == 0x1cc0 || s == 0x1fff || s == 0x2000 || s == 0x3cbf
270 	  || s == 0x3cc0 || s == (0xc000U << BITSH) - 1
271 	  || s == (0xf000U << BITSH) - 1
272 	  || s == (0xbfbfU << BITSH) || s == (0xf000U << BITSH)
273 	  || s == (0x7000 << BITSH)
274 	  || s == (1 << (BITSM1 - 2)) || s == (3 << (BITSM1 - 2)) + 2
275 	  || s == (0xa031U << BITSH) - 1 || s == -1U || s == -15U
276 	  || s == (0x7000 << BITSH) - 1 || s == (1 << (BITSM1 - 2)) - 1
277 	  || s == -32U || s == -5U || s == -63U || s == -64U || s == -65U
278 	  || s == -8189U || s == -8191U || s == -8192U || s == -8193U
279 	  || s == -8250U || s == -8255U || s == -8256U || s == __INT_MAX__)
280 	return;
281     }
282   else
283     {
284       if (s == 0 || s == 0x1cbf || s == 0x20 || s == 0x3f
285 	  || s == (0x9000U << BITSH) - 1 || s == (0xc000U << BITSH)
286 	  || s == (0x9000U << BITSH)
287 	  || s == (0xc000U << BITSH) + 1 || s == 1 || s == -15550U
288 	  || s == -15552U
289 	  || s == 1U + __INT_MAX__ || s == 2
290 	  || s == 24 || s == 5
291 	  || s == 6U + __INT_MAX__ || s == -8257U || s == __INT_MAX__ + 9U)
292 	return;
293     }
294   abort ();
295 }
296 
297 void
f10(unsigned int s)298 f10 (unsigned int s)
299 {
300   if ((s & 0x3cc0) > 0x1cc0)
301     {
302       if (s == 0x2000 || s == 0x3cbf || s == 0x3cc0
303 	  || s == (0xc000U << BITSH) - 1 || s == (0xf000U << BITSH) - 1
304 	  || s == (0xbfbfU << BITSH) || s == (0xa031U << BITSH) - 1
305 	  || s == (0xf000U << BITSH)
306 	  || s == -1U || s == -15U || s == (0x7000 << BITSH) - 1
307 	  || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
308 	  || s == -32U || s == (3 << (BITSM1 - 2)) + 2 || s == -5U
309 	  || s == -63U || s == -64U || s == -65U || s == -8189U || s == -8191U
310 	  || s == -8192U || s == __INT_MAX__)
311 	return;
312     }
313   else
314     {
315       if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x20
316 	  || s == 0x3f || s == (0x9000U << BITSH) - 1
317 	  || s == (0xc000U << BITSH) || s == (0x9000U << BITSH)
318 	  || s == (0xc000U << BITSH) + 1 || s == 1 || s == -15550U
319 	  || s == -15552U || s == (1 << (BITSM1 - 2)) - 1
320 	  || s == 1U + __INT_MAX__ || s == 2
321 	  || s == 24 || s == 5
322 	  || s == 6U + __INT_MAX__ || s == -8193U || s == -8250U
323 	  || s == -8255U || s == -8256U || s == -8257U
324 	  || s == __INT_MAX__ + 9U)
325 	return;
326     }
327   abort ();
328 }
329 
330 void
f11(int s)331 f11 (int s)
332 {
333   if ((s & 0x3cc0) >= 0x1cc0)
334     {
335       if (s == 0x1cc0 || s == 0x1fff || s == 0x2000 || s == 0x3cbf
336 	  || s == 0x3cc0 || s == (-0x4000 << BITSH) - 1
337 	  || s == (-0x1000 << BITSH) - 1
338 	  || s == (-0x4041 << BITSH)
339 	  || s == (-0x1000 << BITSH)
340 	  || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
341 	  || s == (3 << (BITSM1 - 2)) + 2
342 	  || s == (-0x5fcf << BITSH) - 1 || s == -1 || s == -15
343 	  || s == (0x7000 << BITSH) - 1 || s == (1 << (BITSM1 - 2)) - 1
344 	  || s == -32 || s == -5 || s == -63 || s == -64 || s == -65
345 	  || s == -8189 || s == -8191 || s == -8192 || s == -8193
346 	  || s == -8250 || s == -8255 || s == -8256 || s == __INT_MAX__)
347 	return;
348     }
349   else
350     {
351       if (s == 0 || s == 0x1cbf || s == 0x20 || s == 0x3f
352 	  || s == (-0x7000 << BITSH) - 1 || s == (-0x4000 << BITSH)
353 	  || s == (-0x7000 << BITSH)
354 	  || s == (-0x4000 << BITSH) + 1 || s == 1 || s == -15550
355 	  || s == -15552
356 	  || s == -__INT_MAX__ - 1 || s == 2 || s == 24
357 	  || s == 5 || s == -__INT_MAX__ + 4
358 	  || s == -8257 || s == -__INT_MAX__ + 7)
359 	return;
360     }
361   abort ();
362 }
363 
364 void
f12(int s)365 f12 (int s)
366 {
367   if ((s & 0x3cc0) > 0x1cc0)
368     {
369       if (s == 0x2000 || s == 0x3cbf || s == 0x3cc0
370 	  || s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
371 	  || s == (-0x5fcf << BITSH) - 1
372 	  || s == (-0x4041 << BITSH)
373 	  || s == (-0x1000 << BITSH)
374 	  || s == -1 || s == -15 || s == (0x7000 << BITSH) - 1
375 	  || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
376 	  || s == (3 << (BITSM1 - 2)) + 2
377 	  || s == -32 || s == -5 || s == -63
378 	  || s == -64 || s == -65 || s == -8189 || s == -8191 || s == -8192
379 	  || s == __INT_MAX__)
380 	return;
381     }
382   else
383     {
384       if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x20
385 	  || s == 0x3f || s == (-0x7000 << BITSH) - 1
386 	  || s == (-0x4000 << BITSH) || s == (-0x7000 << BITSH)
387 	  || s == (-0x4000 << BITSH) + 1 || s == 1 || s == -15550
388 	  || s == -15552 || s == (1 << (BITSM1 - 2)) - 1
389 	  || s == -__INT_MAX__ - 1 || s == 2 || s == 24
390 	  || s == 5 || s == -__INT_MAX__ + 4
391 	  || s == -8193 || s == -8250 || s == -8255 || s == -8256
392 	  || s == -8257 || s == -__INT_MAX__ + 7)
393 	return;
394     }
395   abort ();
396 }
397 
398 void
f13(unsigned int s)399 f13 (unsigned int s)
400 {
401   if ((s & (0xe071U << BITSH)) > (0xb030U << BITSH))
402     {
403       if (s == (0xf000U << BITSH) - 1 || s == (0xc000U << BITSH)
404 	  || s == (0xf000U << BITSH) || s == (0xc000U << BITSH) + 1
405 	  || s == -1U || s == -15U || s == -15550U || s == -15552U
406 	  || s == -32U || s == -5U || s == -63U || s == -64U || s == -65U
407 	  || s == -8189U || s == -8191U || s == -8192U || s == -8193U
408 	  || s == -8250U || s == -8255U || s == -8256U || s == -8257U)
409 	return;
410     }
411   else
412     {
413       if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
414 	  || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
415 	  || s == (0xc000U << BITSH) - 1 || s == (0x9000U << BITSH) - 1
416 	  || s == (0xa031U << BITSH) - 1 || s == (0xbfbfU << BITSH)
417 	  || s == (0x9000U << BITSH) || s == 1 || s == (0x7000 << BITSH) - 1
418 	  || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
419 	  || s == (1 << (BITSM1 - 2)) - 1 || s == 1U + __INT_MAX__ || s == 2
420 	  || s == 24 || s == (3 << (BITSM1 - 2)) + 2 || s == 5
421 	  || s == 6U + __INT_MAX__ || s == __INT_MAX__
422 	  || s == __INT_MAX__ + 9U)
423 	return;
424     }
425   abort ();
426 }
427 
428 void
f14(unsigned int s)429 f14 (unsigned int s)
430 {
431   if ((s & (0xe071U << BITSH)) > (0xa030U << BITSH))
432     {
433       if (s == (0xc000U << BITSH) - 1 || s == (0xf000U << BITSH) - 1
434 	  || s == (0xbfbfU << BITSH) || s == (0xc000U << BITSH)
435 	  || s == (0xf000U << BITSH) || s == (0xc000U << BITSH) + 1
436 	  || s == -1U || s == -15U || s == -15550U || s == -15552U
437 	  || s == -32U || s == -5U || s == -63U || s == -64U || s == -65U
438 	  || s == -8189U || s == -8191U || s == -8192U || s == -8193U
439 	  || s == -8250U || s == -8255U || s == -8256U || s == -8257U)
440 	return;
441     }
442   else
443     {
444       if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
445 	  || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
446 	  || s == (0x9000U << BITSH) - 1 || s == (0xa031U << BITSH) - 1
447 	  || s == (0x9000U << BITSH) || s == 1 || s == (0x7000 << BITSH) - 1
448 	  || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
449 	  || s == (1 << (BITSM1 - 2)) - 1 || s == 1U + __INT_MAX__ || s == 2
450 	  || s == 24 || s == (3 << (BITSM1 - 2)) + 2 || s == 5
451 	  || s == 6U + __INT_MAX__ || s == __INT_MAX__
452 	  || s == __INT_MAX__ + 9U)
453 	return;
454     }
455   abort ();
456 }
457 
458 void
f15(int s)459 f15 (int s)
460 {
461   if ((s & ((-0x1f8f) << BITSH)) > ((-0x4fd0) << BITSH))
462     {
463       if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
464 	  || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
465 	  || s == (-0x1000 << BITSH) - 1 || s == (-0x4000 << BITSH)
466 	  || s == (-0x1000 << BITSH) || s == (-0x4000 << BITSH) + 1 || s == 1
467 	  || s == -1 || s == -15 || s == -15550 || s == -15552
468 	  || s == (0x7000 << BITSH) - 1 || s == (0x7000 << BITSH)
469 	  || s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
470 	  || s == 2 || s == 24 || s == -32 || s == (3 << (BITSM1 - 2)) + 2
471 	  || s == 5 || s == -5 || s == -63 || s == -64 || s == -65
472 	  || s == -8189 || s == -8191 || s == -8192 || s == -8193
473 	  || s == -8250 || s == -8255 || s == -8256 || s == -8257
474 	  || s == __INT_MAX__)
475 	return;
476     }
477   else
478     {
479       if (s == (-0x4000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
480 	  || s == (-0x5fcf << BITSH) - 1 || s == (-0x4041 << BITSH)
481 	  || s == (-0x7000 << BITSH) || s == -__INT_MAX__ - 1
482 	  || s == -__INT_MAX__ + 4 || s == -__INT_MAX__ + 7)
483 	return;
484     }
485   abort ();
486 }
487 
488 void
f16(int s)489 f16 (int s)
490 {
491   if ((s & ((-0x1f8f) << BITSH)) >= ((-0x4fd0) << BITSH))
492     {
493       if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
494 	  || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
495 	  || s == (-0x1000 << BITSH) - 1 || s == (-0x4000 << BITSH)
496 	  || s == (-0x1000 << BITSH) || s == (-0x4000 << BITSH) + 1 || s == 1
497 	  || s == -1 || s == -15 || s == -15550 || s == -15552
498 	  || s == (0x7000 << BITSH) - 1 || s == (0x7000 << BITSH)
499 	  || s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
500 	  || s == 2 || s == 24 || s == -32 || s == (3 << (BITSM1 - 2)) + 2
501 	  || s == 5 || s == -5 || s == -63 || s == -64 || s == -65
502 	  || s == -8189 || s == -8191 || s == -8192 || s == -8193
503 	  || s == -8250 || s == -8255 || s == -8256 || s == -8257
504 	  || s == __INT_MAX__)
505 	return;
506     }
507   else
508     {
509       if (s == (-0x4000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
510 	  || s == (-0x5fcf << BITSH) - 1 || s == (-0x4041 << BITSH)
511 	  || s == (-0x7000 << BITSH) || s == -__INT_MAX__ - 1
512 	  || s == -__INT_MAX__ + 4 || s == -__INT_MAX__ + 7)
513 	return;
514     }
515   abort ();
516 }
517 
518 void
f17(int s)519 f17 (int s)
520 {
521   if ((s & ((-0x4000 << BITSH) | 1)) != -__INT_MAX__ - 1)
522     {
523       if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
524 	  || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
525 	  || s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
526 	  || s == (-0x7000 << BITSH) - 1 || s == (-0x4041 << BITSH)
527 	  || s == (-0x4000 << BITSH) || s == (-0x1000 << BITSH)
528 	  || s == (-0x4000 << BITSH) + 1 || s == 1 || s == -1 || s == -15
529 	  || s == -15550 || s == -15552 || s == (0x7000 << BITSH) - 1
530 	  || s == (0x7000 << BITSH) || s == (1 << (BITSM1 - 2))
531 	  || s == (1 << (BITSM1 - 2)) - 1 || s == 2 || s == 24 || s == -32
532 	  || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -5 || s == -63
533 	  || s == -64 || s == -65 || s == -__INT_MAX__ + 4 || s == -8189
534 	  || s == -8191 || s == -8192 || s == -8193 || s == -8250
535 	  || s == -8255 || s == -8256 || s == -8257 || s == __INT_MAX__)
536 	return;
537     }
538   else
539     {
540       if (s == (-0x5fcf << BITSH) - 1 || s == (-0x7000 << BITSH)
541 	  || s == -__INT_MAX__ - 1 || s == -__INT_MAX__ + 7)
542 	return;
543     }
544   abort ();
545 }
546 
547 void
f18(int s)548 f18 (int s)
549 {
550   if ((s & ((-0x4000 << BITSH) | 1)) != ((-0x4000 << BITSH) | 1))
551     {
552       if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
553 	  || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
554 	  || s == (-0x4000 << BITSH) - 1 || s == (-0x7000 << BITSH) - 1
555 	  || s == (-0x5fcf << BITSH) - 1 || s == (-0x4041 << BITSH)
556 	  || s == (-0x4000 << BITSH) || s == (-0x1000 << BITSH)
557 	  || s == (-0x7000 << BITSH) || s == 1 || s == -15550 || s == -15552
558 	  || s == (0x7000 << BITSH) - 1 || s == (0x7000 << BITSH)
559 	  || s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
560 	  || s == -__INT_MAX__ - 1 || s == 2 || s == 24 || s == -32
561 	  || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -64
562 	  || s == -__INT_MAX__ + 4 || s == -8192 || s == -8250 || s == -8256
563 	  || s == __INT_MAX__ || s == -__INT_MAX__ + 7)
564 	return;
565     }
566   else
567     {
568       if (s == (-0x1000 << BITSH) - 1 || s == (-0x4000 << BITSH) + 1
569 	  || s == -1 || s == -15 || s == -5 || s == -63 || s == -65
570 	  || s == -8189 || s == -8191 || s == -8193 || s == -8255
571 	  || s == -8257)
572 	return;
573     }
574   abort ();
575 }
576 
577 void
f19(int s)578 f19 (int s)
579 {
580   if ((s & ((-0x4000 << BITSH) | 1)) != ((0x4000 << BITSH) | 1))
581     {
582       if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
583 	  || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
584 	  || s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
585 	  || s == (-0x7000 << BITSH) - 1 || s == (-0x5fcf << BITSH) - 1
586 	  || s == (-0x4041 << BITSH) || s == (-0x4000 << BITSH)
587 	  || s == (-0x1000 << BITSH) || s == (-0x7000 << BITSH)
588 	  || s == (-0x4000 << BITSH) + 1 || s == 1 || s == -1 || s == -15
589 	  || s == -15550 || s == -15552 || s == (0x7000 << BITSH)
590 	  || s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
591 	  || s == -__INT_MAX__ - 1 || s == 2 || s == 24 || s == -32
592 	  || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -5 || s == -63
593 	  || s == -64 || s == -65 || s == -__INT_MAX__ + 4 || s == -8189
594 	  || s == -8191 || s == -8192 || s == -8193 || s == -8250
595 	  || s == -8255 || s == -8256 || s == -8257 || s == -__INT_MAX__ + 7)
596 	return;
597     }
598   else
599     {
600       if (s == (0x7000 << BITSH) - 1 || s == __INT_MAX__)
601 	return;
602     }
603   abort ();
604 }
605 
606 void
f20(int s)607 f20 (int s)
608 {
609   if ((s & (-0x1000 << BITSH)) != -__INT_MAX__ - 1)
610     {
611       if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
612 	  || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
613 	  || s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
614 	  || s == (-0x5fcf << BITSH) - 1 || s == (-0x4041 << BITSH)
615 	  || s == (-0x4000 << BITSH) || s == (-0x1000 << BITSH)
616 	  || s == (-0x7000 << BITSH) || s == (-0x4000 << BITSH) + 1 || s == 1
617 	  || s == -1 || s == -15 || s == -15550 || s == -15552
618 	  || s == (0x7000 << BITSH) - 1 || s == (0x7000 << BITSH)
619 	  || s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
620 	  || s == 2 || s == 24 || s == -32 || s == (3 << (BITSM1 - 2)) + 2
621 	  || s == 5 || s == -5 || s == -63 || s == -64 || s == -65
622 	  || s == -8189 || s == -8191 || s == -8192 || s == -8193
623 	  || s == -8250 || s == -8255 || s == -8256 || s == -8257
624 	  || s == __INT_MAX__)
625 	return;
626     }
627   else
628     {
629       if (s == (-0x7000 << BITSH) - 1 || s == -__INT_MAX__ - 1
630 	  || s == -__INT_MAX__ + 4 || s == -__INT_MAX__ + 7)
631 	return;
632     }
633   abort ();
634 }
635 
636 void
f21(int s)637 f21 (int s)
638 {
639   if ((s & (-0x1000 << BITSH)) != (-0x1000 << BITSH))
640     {
641       if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
642 	  || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
643 	  || s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
644 	  || s == (-0x7000 << BITSH) - 1 || s == (-0x5fcf << BITSH) - 1
645 	  || s == (-0x4041 << BITSH) || s == (-0x4000 << BITSH)
646 	  || s == (-0x7000 << BITSH) || s == (-0x4000 << BITSH) + 1 || s == 1
647 	  || s == -15550 || s == -15552
648 	  || s == (0x7000 << BITSH) - 1 || s == (0x7000 << BITSH)
649 	  || s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
650 	  || s == -__INT_MAX__ - 1 || s == 2 || s == 24
651 	  || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -__INT_MAX__ + 4
652 	  || s == -8189 || s == -8191 || s == -8192 || s == -8193
653 	  || s == -8250 || s == -8255 || s == -8256 || s == -8257
654 	  || s == __INT_MAX__ || s == -__INT_MAX__ + 7)
655 	return;
656     }
657   else
658     {
659       if (s == (-0x1000 << BITSH) || s == -1 || s == -15
660 	  || s == -32 || s == -5 || s == -63 || s == -64
661 	  || s == -65)
662 	return;
663     }
664   abort ();
665 }
666 
667 void
f22(int s)668 f22 (int s)
669 {
670   if ((s & (-0x1000 << BITSH)) != (0x7000 << BITSH))
671     {
672       if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
673 	  || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
674 	  || s == (-0x4000 << BITSH) - 1 || s == (-0x1000 << BITSH) - 1
675 	  || s == (-0x7000 << BITSH) - 1 || s == (-0x5fcf << BITSH) - 1
676 	  || s == (-0x4041 << BITSH) || s == (-0x4000 << BITSH)
677 	  || s == (-0x1000 << BITSH) || s == (-0x7000 << BITSH)
678 	  || s == (-0x4000 << BITSH) + 1 || s == 1 || s == -1 || s == -15
679 	  || s == -15550 || s == -15552 || s == (0x7000 << BITSH) - 1
680 	  || s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
681 	  || s == -__INT_MAX__ - 1 || s == 2 || s == 24 || s == -32
682 	  || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -5 || s == -63
683 	  || s == -64 || s == -65 || s == -__INT_MAX__ + 4 || s == -8189
684 	  || s == -8191 || s == -8192 || s == -8193 || s == -8250
685 	  || s == -8255 || s == -8256 || s == -8257 || s == -__INT_MAX__ + 7)
686 	return;
687     }
688   else
689     {
690       if (s == (0x7000 << BITSH) || s == __INT_MAX__)
691 	return;
692     }
693   abort ();
694 }
695 
696 void
f23(unsigned int s)697 f23 (unsigned int s)
698 {
699   if ((s & (0xf000U << BITSH)) != (0x7000 << BITSH))
700     {
701       if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
702 	  || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
703 	  || s == (0xc000U << BITSH) - 1 || s == (0xf000U << BITSH) - 1
704 	  || s == (0x9000U << BITSH) - 1 || s == (0xa031U << BITSH) - 1
705 	  || s == (0xbfbfU << BITSH) || s == (0xc000U << BITSH)
706 	  || s == (0xf000U << BITSH) || s == (0x9000U << BITSH)
707 	  || s == (0xc000U << BITSH) + 1 || s == 1 || s == -1U || s == -15U
708 	  || s == -15550U || s == -15552U || s == (0x7000 << BITSH) - 1
709 	  || s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
710 	  || s == 1U + __INT_MAX__ || s == 2 || s == 24 || s == -32U
711 	  || s == (3 << (BITSM1 - 2)) + 2 || s == 5 || s == -5U || s == -63U
712 	  || s == -64U || s == -65U || s == 6U + __INT_MAX__ || s == -8189U
713 	  || s == -8191U || s == -8192U || s == -8193U || s == -8250U
714 	  || s == -8255U || s == -8256U || s == -8257U
715 	  || s == __INT_MAX__ + 9U)
716 	return;
717     }
718   else
719     {
720       if (s == (0x7000 << BITSH) || s == __INT_MAX__)
721 	return;
722     }
723   abort ();
724 }
725 
726 void
f24(unsigned int s)727 f24 (unsigned int s)
728 {
729   if ((s & (0xf000U << BITSH)) != (0x8000U << BITSH))
730     {
731       if (s == 0 || s == 0x1cbf || s == 0x1cc0 || s == 0x1fff || s == 0x2000
732 	  || s == 0x20 || s == 0x3cbf || s == 0x3cc0 || s == 0x3f
733 	  || s == (0xc000U << BITSH) - 1 || s == (0xf000U << BITSH) - 1
734 	  || s == (0xa031U << BITSH) - 1 || s == (0xbfbfU << BITSH)
735 	  || s == (0xc000U << BITSH) || s == (0xf000U << BITSH)
736 	  || s == (0x9000U << BITSH) || s == (0xc000U << BITSH) + 1 || s == 1
737 	  || s == -1U || s == -15U || s == -15550U || s == -15552U
738 	  || s == (0x7000 << BITSH) - 1 || s == (0x7000 << BITSH)
739 	  || s == (1 << (BITSM1 - 2)) || s == (1 << (BITSM1 - 2)) - 1
740 	  || s == 2 || s == 24 || s == -32U || s == (3 << (BITSM1 - 2)) + 2
741 	  || s == 5 || s == -5U || s == -63U || s == -64U || s == -65U
742 	  || s == -8189U || s == -8191U || s == -8192U || s == -8193U
743 	  || s == -8250U || s == -8255U || s == -8256U || s == -8257U
744 	  || s == __INT_MAX__)
745 	return;
746     }
747   else
748     {
749       if (s == (0x9000U << BITSH) - 1 || s == 1U + __INT_MAX__
750 	  || s == 6U + __INT_MAX__ || s == __INT_MAX__ + 9U)
751 	return;
752     }
753   abort ();
754 }
755 
756 /* Make this easier to run on microcontroller architectures by using a switch
757    statements instead of arrays.
758    We still don't want the compiler to constant-propagate the array contents,
759    so use an asm in each accessor function with to hide what's going on.  */
760 
761 int
svals(int i)762 svals (int i)
763 {
764   asm ("" : "=g" (i) : "0" (i));
765   switch (i)
766     {
767     case  0: return 0;
768     case  1: return 0x1cbf;
769     case  2: return 0x1cc0;
770     case  3: return 0x1fff;
771     case  4: return 0x2000;
772     case  5: return 0x20;
773     case  6: return 0x3cbf;
774     case  7: return 0x3cc0;
775     case  8: return 0x3f;
776     case  9: return (-0x4000 << BITSH) - 1;
777     case 10: return (-0x1000 << BITSH) - 1;
778     case 11: return (-0x7000 << BITSH) - 1;
779     case 12: return (-0x5fcf << BITSH) - 1;
780     case 13: return (-0x4041 << BITSH);
781     case 14: return (-0x4000 << BITSH);
782     case 15: return (-0x1000 << BITSH);
783     case 16: return (-0x7000 << BITSH);
784     case 17: return (-0x4000 << BITSH) + 1;
785     case 18: return 1;
786     case 19: return -1;
787     case 20: return -15;
788     case 21: return -15550;
789     case 22: return -15552;
790     case 23: return (0x7000 << BITSH) - 1;
791     case 24: return (0x7000 << BITSH);
792     case 25: return (1 << (BITSM1 - 2));
793     case 26: return (1 << (BITSM1 - 2)) - 1;
794     case 27: return -__INT_MAX__ - 1;
795     case 28: return 2;
796     case 29: return 24;
797     case 30: return -32;
798     case 31: return (3 << (BITSM1 - 2)) + 2;
799     case 32: return 5;
800     case 33: return -5;
801     case 34: return -63;
802     case 35: return -64;
803     case 36: return -65;
804     case 37: return -__INT_MAX__ + 4;
805     case 38: return -8189;
806     case 39: return -8191;
807     case 40: return -8192;
808     case 41: return -8193;
809     case 42: return -8250;
810     case 43: return -8255;
811     case 44: return -8256;
812     case 45: return -8257;
813     case 46: return __INT_MAX__;
814     case 47: return -__INT_MAX__ + 7;
815 #define SVAL_NUM 48
816     default: abort ();
817     }
818 };
819 
820 unsigned int
uvals(int i)821 uvals (int i)
822 {
823   asm ("" : "=g" (i) : "0" (i));
824   switch (i)
825     {
826     case  0: return 0;
827     case  1: return 0x1cbf;
828     case  2: return 0x1cc0;
829     case  3: return 0x1fff;
830     case  4: return 0x2000;
831     case  5: return 0x20;
832     case  6: return 0x3cbf;
833     case  7: return 0x3cc0;
834     case  8: return 0x3f;
835     case  9: return (0xc000U << BITSH) - 1;
836     case 10: return (0xf000U << BITSH) - 1;
837     case 11: return (0x9000U << BITSH) - 1;
838     case 12: return (0xa031U << BITSH) - 1;
839     case 13: return (0xbfbfU << BITSH);
840     case 14: return (0xc000U << BITSH);
841     case 15: return (0xf000U << BITSH);
842     case 16: return (0x9000U << BITSH);
843     case 17: return (0xc000U << BITSH) + 1;
844     case 18: return 1;
845     case 19: return -1U;
846     case 20: return -15U;
847     case 21: return -15550U;
848     case 22: return -15552U;
849     case 23: return (0x7000 << BITSH) - 1;
850     case 24: return (0x7000 << BITSH);
851     case 25: return (1 << (BITSM1 - 2));
852     case 26: return (1 << (BITSM1 - 2)) - 1;
853     case 27: return 1U + __INT_MAX__;
854     case 28: return 2;
855     case 29: return 24;
856     case 30: return -32U;
857     case 31: return (3 << (BITSM1 - 2)) + 2;
858     case 32: return 5;
859     case 33: return -5U;
860     case 34: return -63U;
861     case 35: return -64U;
862     case 36: return -65U;
863     case 37: return 6U + __INT_MAX__;
864     case 38: return -8189U;
865     case 39: return -8191U;
866     case 40: return -8192U;
867     case 41: return -8193U;
868     case 42: return -8250U;
869     case 43: return -8255U;
870     case 44: return -8256U;
871     case 45: return -8257U;
872     case 46: return __INT_MAX__;
873     case 47: return __INT_MAX__ + 9U;
874 #define UVAL_NUM 48
875     default: abort ();
876     }
877 };
878 
879 int
main()880 main ()
881 {
882   int i;
883   for (i = 0; i < SVAL_NUM; i++)
884     {
885       f2 (svals (i));
886       f4 (svals (i));
887       f5 (svals (i));
888       f7 (svals (i));
889       f8 (svals (i));
890       f11 (svals (i));
891       f12 (svals (i));
892       f15 (svals (i));
893       f16 (svals (i));
894       f17 (svals (i));
895       f18 (svals (i));
896       f19 (svals (i));
897       f20 (svals (i));
898       f21 (svals (i));
899       f22 (svals (i));
900     }
901   for (i = 0; i < UVAL_NUM; i++)
902     {
903       f1 (uvals (i));
904       f3 (uvals (i));
905       f6 (uvals (i));
906       f9 (uvals (i));
907       f10 (uvals (i));
908       f13 (uvals (i));
909       f14 (uvals (i));
910       f23 (uvals (i));
911       f24 (uvals (i));
912     }
913   return 0;
914 }
915