aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorseyko <seyko2@gmail.com>2015-03-03 15:51:09 +0300
committerseyko <seyko2@gmail.com>2015-03-03 15:51:09 +0300
commit2437ccdc768b1a4fde3255b2090e180b74ab198f (patch)
treef66c0114a12a3974f13abc001b5ac0f87e9750b0
parentc45a8695ebbcbad812993d530e69bfa2de33f131 (diff)
downloadtinycc-2437ccdc768b1a4fde3255b2090e180b74ab198f.tar.gz
tinycc-2437ccdc768b1a4fde3255b2090e180b74ab198f.tar.bz2
A partial reverse for commit eda2c756edc4dca004ba217d5bf361235dd9de1f
Author: Thomas Preud'homme <robotux@celest.fr> Date: Tue Dec 31 23:51:20 2013 +0800 Move logic for if (int value) to tccgen.c Move the logic to do a test of an integer value (ex if (0)) out of arch-specific code to tccgen.c to avoid code duplication. This also fixes test of long long value which was only testing the bottom half of such values on 32 bits architectures. I don't understand why if () in gtst(i) was removed. This patch allows to compile a linux kernel v.2.4.26 W/o this patch a tcc simply crashes.
-rw-r--r--arm-gen.c2
-rw-r--r--c67-gen.c2
-rw-r--r--i386-gen.c2
-rw-r--r--il-gen.c2
-rw-r--r--x86_64-gen.c2
5 files changed, 5 insertions, 5 deletions
diff --git a/arm-gen.c b/arm-gen.c
index 680a490..5dd6c5e 100644
--- a/arm-gen.c
+++ b/arm-gen.c
@@ -1418,7 +1418,7 @@ int gtst(int inv, int t)
op|=encbranch(r,t,1);
o(op);
t=r;
- } else { /* VT_JMP || VT_JMPI */
+ } else if (v == VT_JMP || v == VT_JMPI) {
if ((v & 1) == inv) {
if(!vtop->c.i)
vtop->c.i=t;
diff --git a/c67-gen.c b/c67-gen.c
index a26dfaa..5a6fd56 100644
--- a/c67-gen.c
+++ b/c67-gen.c
@@ -2102,7 +2102,7 @@ int gtst(int inv, int t)
C67_NOP(5);
t = ind1; //return where we need to patch
- } else { /* VT_JMP || VT_JMPI */
+ } else if (v == VT_JMP || v == VT_JMPI) {
/* && or || optimization */
if ((v & 1) == inv) {
/* insert vtop->c jump list in t */
diff --git a/i386-gen.c b/i386-gen.c
index ece054b..eca4ddd 100644
--- a/i386-gen.c
+++ b/i386-gen.c
@@ -677,7 +677,7 @@ ST_FUNC int gtst(int inv, int t)
/* fast case : can jump directly since flags are set */
g(0x0f);
t = psym((vtop->c.i - 16) ^ inv, t);
- } else { /* VT_JMP || VT_JMPI */
+ } else if (v == VT_JMP || v == VT_JMPI) {
/* && or || optimization */
if ((v & 1) == inv) {
/* insert vtop->c jump list in t */
diff --git a/il-gen.c b/il-gen.c
index 9e1ec64..cf3aff5 100644
--- a/il-gen.c
+++ b/il-gen.c
@@ -516,7 +516,7 @@ int gtst(int inv, int t)
break;
}
t = out_opj(c, t);
- } else { /* VT_JMP || VT_JMPI */
+ } else if (v == VT_JMP || v == VT_JMPI) {
/* && or || optimization */
if ((v & 1) == inv) {
/* insert vtop->c jump list in t */
diff --git a/x86_64-gen.c b/x86_64-gen.c
index c8fed85..67aaadc 100644
--- a/x86_64-gen.c
+++ b/x86_64-gen.c
@@ -1592,7 +1592,7 @@ int gtst(int inv, int t)
}
g(0x0f);
t = psym((vtop->c.i - 16) ^ inv, t);
- } else { /* VT_JMP || VT_JMPI */
+ } else if (v == VT_JMP || v == VT_JMPI) {
/* && or || optimization */
if ((v & 1) == inv) {
/* insert vtop->c jump list in t */