1 /* PR tree-optimization/51721 */ 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 9 void f1(unsigned int s)10f1 (unsigned int s) 11 { 12 if (s >> BITSM1 != 0) 13 { 14 if (s == 0 || s == 5 || s == __INT_MAX__) 15 link_error (); 16 } 17 else 18 { 19 if (s == 1U + __INT_MAX__ || s == 6U + __INT_MAX__ || s == -1U) 20 link_error (); 21 } 22 } 23 24 void f2(int s)25f2 (int s) 26 { 27 if (s >> BITSM1 == 0) 28 { 29 if (s == -1 || s == -5 || s == -__INT_MAX__ - 1) 30 link_error (); 31 } 32 else 33 { 34 if (s == 0 || s == 5 || s == __INT_MAX__) 35 link_error (); 36 } 37 } 38 39 void f3(unsigned int s)40f3 (unsigned int s) 41 { 42 if ((s & (1U << BITSM1)) != 0) 43 { 44 if (s == 0 || s == 5 || s == __INT_MAX__) 45 link_error (); 46 } 47 else 48 { 49 if (s == 1U + __INT_MAX__ || s == 6U + __INT_MAX__ || s == -1U) 50 link_error (); 51 } 52 } 53 54 void f4(int s)55f4 (int s) 56 { 57 if ((s & (1U << BITSM1)) == 0) 58 { 59 if (s == -1 || s == -5 || s == -__INT_MAX__ - 1) 60 link_error (); 61 } 62 else 63 { 64 if (s == 0 || s == 5 || s == __INT_MAX__) 65 link_error (); 66 } 67 } 68 69 void f5(unsigned int s)70f5 (unsigned int s) 71 { 72 if ((int) s < 0) 73 { 74 if (s == 0 || s == 5 || s == __INT_MAX__) 75 link_error (); 76 } 77 else 78 { 79 if (s == 1U + __INT_MAX__ || s == 6U + __INT_MAX__ || s == -1U) 80 link_error (); 81 } 82 } 83 84 void f6(unsigned int s)85f6 (unsigned int s) 86 { 87 if ((int) s < 4) 88 { 89 if (s == 4 || s == 6 || s == __INT_MAX__) 90 link_error (); 91 } 92 else 93 { 94 if (s == 1U + __INT_MAX__ || s == 6U + __INT_MAX__ || s == -1U 95 || s == 3 || s == 0) 96 link_error (); 97 } 98 } 99 100 void f7(unsigned int s)101f7 (unsigned int s) 102 { 103 if ((int) s <= -7) 104 { 105 if (s == -6U || s == -1U || s == 0 || s == 4 || s == 6 || s == __INT_MAX__) 106 link_error (); 107 } 108 else 109 { 110 if (s == 1U + __INT_MAX__ || s == 6U + __INT_MAX__ || s == -9U 111 || s == -7U) 112 link_error (); 113 } 114 } 115 116 void f8(unsigned int s)117f8 (unsigned int s) 118 { 119 if ((int) s >= 4) 120 { 121 if (s == 1U + __INT_MAX__ || s == 6U + __INT_MAX__ || s == -1U 122 || s == 3 || s == 0) 123 link_error (); 124 } 125 else 126 { 127 if (s == 4 || s == 6 || s == __INT_MAX__) 128 link_error (); 129 } 130 } 131 132 void f9(unsigned int s)133f9 (unsigned int s) 134 { 135 if ((int) s > -7) 136 { 137 if (s == 1U + __INT_MAX__ || s == 6U + __INT_MAX__ || s == -9U 138 || s == -7U) 139 link_error (); 140 } 141 else 142 { 143 if (s == -6U || s == -1U || s == 0 || s == 4 || s == 6 || s == __INT_MAX__) 144 link_error (); 145 } 146 } 147 148 int main()149main () 150 { 151 return 0; 152 } 153