the optimization of a ternary op with two boolean operands had the same problem (as in the last commit) of loosing the type.
Showing the changes to tests/tcctest.c (1 of 2 files). Show all
Unified · Split
| @@ -1269,6 +1269,7 @@ void bool_test() · 1268 unmodified lines | |||
| 1269 | t = 1; | 1269 | t = 1; |
| 1270 | printf("type of bool: %d\n", (int) ( (~ ((unsigned int) (t && 1))) / 2) ); | 1270 | printf("type of bool: %d\n", (int) ( (~ ((unsigned int) (t && 1))) / 2) ); |
| 1271 | 1271 | ||
| 1272 | printf("type of cond: %d\n", (~(t ? 0U : (unsigned int)0)) / 2 ); | ||
| 1272 | /* test ? : cast */ | 1273 | /* test ? : cast */ |
| 1273 | { | 1274 | { |
| 1274 | int aspect_on; | 1275 | int aspect_on; |