Rework expr_infix

- revert const-folding in gvtst() and put it back into
  expr_landor().  Although it did make sense, one reason
  not to do it is __builtin_constant_p() which may return
  true when it shouldn't because of nocode_wanted, see test.

- tccgen_init() can do init_prec(), also for tcc -E.

- for nostalgic reasons, keep the original expression parser
  functions in the source.

- Makefile: remove stale stuff
This commit is contained in:
grischka
2020-01-21 14:23:57 +01:00
parent aeac24de98
commit 7e901299bf
5 changed files with 191 additions and 82 deletions

View File

@@ -3736,6 +3736,9 @@ void builtin_test(void)
printf("res = %d\n", __builtin_constant_p(1));
printf("res = %d\n", __builtin_constant_p(1 + 2));
printf("res = %d\n", __builtin_constant_p(&constant_p_var));
printf("res = %d\n", __builtin_constant_p(constant_p_var));
printf("res = %d\n", __builtin_constant_p(100000 / constant_p_var));
printf("res = %d\n", __builtin_constant_p(i && 0));
printf("res = %d\n", __builtin_constant_p(i && 1));
printf("res = %d\n", __builtin_constant_p(i && 0 ? i : 34));
s = 1;