aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrischka <grischka>2011-07-16 15:53:30 +0200
committergrischka <grischka>2011-07-16 15:53:30 +0200
commitd7d845888808da6191ab6a70942fac6e3eb815ea (patch)
treeb0ae42c05a41200e0cd4c0359eac85549aac3fa3
parentadc80009c8cc71f5dc01192ea116e9d97f417767 (diff)
downloadtinycc-d7d845888808da6191ab6a70942fac6e3eb815ea.tar.gz
tinycc-d7d845888808da6191ab6a70942fac6e3eb815ea.tar.bz2
Revert "better constant handling for expr_cond"
It produced wrong code with one of my test projects. This reverts commit cd3d1a45f34be3c9a358f1743bcaf8aac897992e.
-rw-r--r--tccgen.c5
-rw-r--r--tests/tcctest.c2
2 files changed, 1 insertions, 6 deletions
diff --git a/tccgen.c b/tccgen.c
index a7f943d..cfa7d8f 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -4040,10 +4040,6 @@ static void expr_cond(void)
if (const_wanted) {
expr_lor_const();
- } else {
- expr_lor();
- }
- if (const_wanted || ((vtop->r & (VT_VALMASK | VT_LVAL | VT_SYM)) == VT_CONST)) {
if (tok == '?') {
CType boolean;
int c;
@@ -4065,6 +4061,7 @@ static void expr_cond(void)
vpop();
}
} else {
+ expr_lor();
if (tok == '?') {
next();
if (vtop != vstack) {
diff --git a/tests/tcctest.c b/tests/tcctest.c
index 92f239e..3581a7a 100644
--- a/tests/tcctest.c
+++ b/tests/tcctest.c
@@ -2083,8 +2083,6 @@ void *bounds_checking_is_enabled()
return (ca != cp + 1) ? cp : NULL;
}
-typedef int constant_negative_array_size_as_compile_time_assertion_idiom[(1 ? 2 : 0) - 1];
-
void c99_vla_test(int size1, int size2)
{
#if defined __i386__ || defined __x86_64__