1 /* PR tree-optimization/21643 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fdump-tree-reassoc1-details" } */
4 
5 int
f1(unsigned char c)6 f1 (unsigned char c)
7 {
8   if (c == 0x22 || c == 0x20 || c < 0x20)
9     return 1;
10   return 0;
11 }
12 
13 int
f2(unsigned char c)14 f2 (unsigned char c)
15 {
16   if (c == 0x22 || c <= 0x20)
17     return 1;
18   return 0;
19 }
20 
21 int
f3(unsigned char c)22 f3 (unsigned char c)
23 {
24   if (c == 0x22)
25     return 1;
26   if (c == 0x20)
27     return 1;
28   if (c < 0x20)
29     return 1;
30   return 0;
31 }
32 
33 int
f4(unsigned char c)34 f4 (unsigned char c)
35 {
36   if (c == 0x22 || c == 0x20 || c < 0x20)
37     return 2;
38   return 0;
39 }
40 
41 int
f5(unsigned char c)42 f5 (unsigned char c)
43 {
44   if (c == 0x22 || c <= 0x20)
45     return 2;
46   return 0;
47 }
48 
49 int
f6(unsigned char c)50 f6 (unsigned char c)
51 {
52   if (c == 0x22)
53     return 2;
54   if (c == 0x20)
55     return 2;
56   if (c < 0x20)
57     return 2;
58   return 0;
59 }
60 
61 int
f7(unsigned char c)62 f7 (unsigned char c)
63 {
64   if (c != 0x22 && c != 0x20 && c >= 0x20)
65     return 0;
66   return 1;
67 }
68 
69 int
f8(unsigned char c)70 f8 (unsigned char c)
71 {
72   if (c == 0x22 && c <= 0x20)
73     return 0;
74   return 1;
75 }
76 
77 int
f9(unsigned char c)78 f9 (unsigned char c)
79 {
80   if (c == 0x22)
81     return 0;
82   if (c == 0x20)
83     return 0;
84   if (c < 0x20)
85     return 0;
86   return 1;
87 }
88 
89 /* { dg-final { scan-tree-dump-times "Optimizing range tests c_\[0-9\]*.D. -.0, 31. and -.32, 32.\[\n\r\]* into" 6 "reassoc1" } } */
90 /* { dg-final { cleanup-tree-dump "reassoc1" } } */
91