1 /* PR tree-optimization/52267 */
2 /* { dg-do link } */
3 /* { dg-options "-O2" } */
4 
5 extern void link_error (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 <= (1U << (BITSM1 - 2)) - 1)
16 	link_error ();
17     }
18   else
19     {
20       if (s >= (1U << (BITSM1 - 2)))
21 	link_error ();
22     }
23 }
24 
25 void
f2(int s)26 f2 (int s)
27 {
28   if ((s & (7U << (BITSM1 - 2))) == 0)
29     {
30       if (s >= (1 << (BITSM1 - 2)) || s < 0)
31 	link_error ();
32     }
33   else
34     {
35       if (s >= 0 && s <= (1 << (BITSM1 - 2)) - 1)
36 	link_error ();
37     }
38 }
39 
40 void
f3(unsigned int s)41 f3 (unsigned int s)
42 {
43   if ((s & 0x3cc0) == 0)
44     {
45       if (s >= -15552U)
46 	link_error ();
47     }
48   else
49     {
50       if (s <= 0x3f)
51 	link_error ();
52     }
53 }
54 
55 void
f4(int s)56 f4 (int s)
57 {
58   if ((s & 0x3cc0) == 0)
59     {
60       if (s >= -15552 && s < 0)
61 	link_error ();
62     }
63   else
64     {
65       if (/* s <= 0x3fU */ s == 0 || s == 0x20 || s == 0x3f)
66 	link_error ();
67     }
68 }
69 
70 void
f5(int s)71 f5 (int s)
72 {
73   if ((s & 0x3cc0U) == 0)
74     {
75       if (s >= -15552 && s < 0)
76 	link_error ();
77     }
78   else
79     {
80       if (/* s <= 0x3fU */ s == 0 || s == 0x20 || s == 0x3f)
81 	link_error ();
82     }
83 }
84 
85 void
f6(unsigned int s)86 f6 (unsigned int s)
87 {
88   if ((s & 0x3cc0) == 0x3cc0)
89     {
90       if (s <= 0x3cbf)
91 	link_error ();
92     }
93   else
94     {
95       if (s >= -64U)
96 	link_error ();
97     }
98 }
99 
100 void
f7(int s)101 f7 (int s)
102 {
103   if ((s & 0x3cc0) == 0x3cc0)
104     {
105       if (s >= 0 && s <= 0x3cbf)
106 	link_error ();
107     }
108   else
109     {
110       if (s >= -64 && s < 0)
111 	link_error ();
112     }
113 }
114 
115 void
f8(int s)116 f8 (int s)
117 {
118   if ((s & 0x3cc0U) == 0x3cc0)
119     {
120       if (s >= 0 && s <= 0x3cbf)
121 	link_error ();
122     }
123   else
124     {
125       if (s >= -64 && s < 0)
126 	link_error ();
127     }
128 }
129 
130 void
f9(unsigned int s)131 f9 (unsigned int s)
132 {
133   if ((s & 0x3cc0) >= 0x1cc0)
134     {
135       if (s <= 0x1cbf)
136 	link_error ();
137     }
138   else
139     {
140       if (s >= -8256U)
141 	link_error ();
142     }
143 }
144 
145 void
f10(unsigned int s)146 f10 (unsigned int s)
147 {
148   if ((s & 0x3cc0) > 0x1cc0)
149     {
150       if (s <= 0x1fff)
151 	link_error ();
152     }
153   else
154     {
155       if (s >= -8192U)
156 	link_error ();
157     }
158 }
159 
160 void
f11(int s)161 f11 (int s)
162 {
163   if ((s & 0x3cc0) >= 0x1cc0)
164     {
165       if (s >= 0 && s <= 0x1cbf)
166 	link_error ();
167     }
168   else
169     {
170       if (s >= -8256 && s < 0)
171 	link_error ();
172     }
173 }
174 
175 void
f12(int s)176 f12 (int s)
177 {
178   if ((s & 0x3cc0) > 0x1cc0)
179     {
180       if (s >= 0 && s <= 0x1fff)
181 	link_error ();
182     }
183   else
184     {
185       if (s >= -8192 && s < 0)
186 	link_error ();
187     }
188 }
189 
190 void
f13(unsigned int s)191 f13 (unsigned int s)
192 {
193   if ((s & (0xe071U << BITSH)) > (0xb030U << BITSH))
194     {
195       if (s <= ((0xc000U << BITSH) - 1))
196 	link_error ();
197     }
198   else
199     {
200       if (s >= (0xc000U << BITSH))
201 	link_error ();
202     }
203 }
204 
205 void
f14(unsigned int s)206 f14 (unsigned int s)
207 {
208   if ((s & (0xe071U << BITSH)) > (0xa030U << BITSH))
209     {
210       if (s <= ((0xa031U << BITSH) - 1))
211 	link_error ();
212     }
213   else
214     {
215       if (s >= (0xbfbfU << BITSH))
216 	link_error ();
217     }
218 }
219 
220 void
f15(int s)221 f15 (int s)
222 {
223   if ((s & ((-0x1f8f) << BITSH)) > ((-0x4fd0) << BITSH))
224     {
225       if (s <= ((-0x4000 << BITSH) - 1))
226 	link_error ();
227     }
228   else
229     {
230       if (s > ((-0x4000 << BITSH) - 1))
231 	link_error ();
232     }
233 }
234 
235 void
f16(int s)236 f16 (int s)
237 {
238   if ((s & ((-0x1f8f) << BITSH)) >= ((-0x4fd0) << BITSH))
239     {
240       if (s <= ((-0x4000 << BITSH) - 1))
241 	link_error ();
242     }
243   else
244     {
245       if (s > ((-0x4000 << BITSH) - 1))
246 	link_error ();
247     }
248 }
249 
250 void
f17(int s)251 f17 (int s)
252 {
253   if ((s & ((-0x4000 << BITSH) | 1)) != -__INT_MAX__ - 1)
254     {
255       if (s == -__INT_MAX__ - 1)
256 	link_error ();
257     }
258   else
259     {
260       if (s >= (-0x4000 << BITSH) - 1)
261 	link_error ();
262     }
263 }
264 
265 void
f18(int s)266 f18 (int s)
267 {
268   if ((s & ((-0x4000 << BITSH) | 1)) != ((-0x4000 << BITSH) | 1))
269     {
270       if (s == -1)
271 	link_error ();
272     }
273   else
274     {
275       if (s < ((-0x4000 << BITSH) | 1) || s >= 0)
276 	link_error ();
277     }
278 }
279 
280 void
f19(int s)281 f19 (int s)
282 {
283   if ((s & ((-0x4000 << BITSH) | 1)) != ((0x4000 << BITSH) | 1))
284     {
285       if (s == __INT_MAX__)
286 	link_error ();
287     }
288   else
289     {
290       if (s <= (0x4000 << BITSH))
291 	link_error ();
292     }
293 }
294 
295 void
f20(int s)296 f20 (int s)
297 {
298   if ((s & (-0x1000 << BITSH)) != -__INT_MAX__ - 1)
299     {
300       if (s < (-0x7000 << BITSH))
301 	link_error ();
302     }
303   else
304     {
305       if (s >= (-0x7000 << BITSH))
306 	link_error ();
307     }
308 }
309 
310 void
f21(int s)311 f21 (int s)
312 {
313   if ((s & (-0x1000 << BITSH)) != (-0x1000 << BITSH))
314     {
315       if (s >= (-0x1000 << BITSH) && s < 0)
316 	link_error ();
317     }
318   else
319     {
320       if (s < (-0x1000 << BITSH) || s >= 0)
321 	link_error ();
322     }
323 }
324 
325 void
f22(int s)326 f22 (int s)
327 {
328   if ((s & (-0x1000 << BITSH)) != (0x7000 << BITSH))
329     {
330       if (s >= (0x7000 << BITSH))
331 	link_error ();
332     }
333   else
334     {
335       if (s < (0x7000 << BITSH))
336 	link_error ();
337     }
338 }
339 
340 void
f23(unsigned int s)341 f23 (unsigned int s)
342 {
343   if ((s & (0xf000U << BITSH)) != (0x7000 << BITSH))
344     {
345       if (/* s >= (0x7000 << BITSH) && s < (0x8000U << BITSH) */
346 	  s == (0x7000 << BITSH) || s == __INT_MAX__)
347 	link_error ();
348     }
349   else
350     {
351       if (s < (0x7000 << BITSH) || s >= (0x8000U << BITSH))
352 	link_error ();
353     }
354 }
355 
356 void
f24(unsigned int s)357 f24 (unsigned int s)
358 {
359   if ((s & (0xf000U << BITSH)) != (0x8000U << BITSH))
360     {
361       if (/* s >= (0x8000U << BITSH) && s < (0x9000U << BITSH) */
362 	  s == (0x8000U << BITSH) || s == (0x9000U << BITSH) - 1)
363 	link_error ();
364     }
365   else
366     {
367       if (s >= (0x9000U << BITSH) || s < (0x8000U << BITSH))
368 	link_error ();
369     }
370 }
371 
372 int
main()373 main ()
374 {
375   return 0;
376 }
377