History

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.

seyko committed 11 years ago

Commit 2437ccd1 parent c45a8695 files · +5 −5Browse files

Unified · Split

5 files
  1. arm-gen.c +1 −1
  2. c67-gen.c +1 −1
  3. i386-gen.c +1 −1
  4. il-gen.c +1 −1
  5. x86_64-gen.c +1 −1
arm-gen.c+1−1
@@ -1418,7 +1418,7 @@ int gtst(int inv, int t) · 1417 unmodified lines
14181418 op|=encbranch(r,t,1);
14191419 o(op);
14201420 t=r;
1421− } else { /* VT_JMP || VT_JMPI */
1421+ } else if (v == VT_JMP || v == VT_JMPI) {
14221422 if ((v & 1) == inv) {
14231423 if(!vtop->c.i)
14241424 vtop->c.i=t;
c67-gen.c+1−1
@@ -2102,7 +2102,7 @@ int gtst(int inv, int t) · 2101 unmodified lines
21022102 C67_NOP(5);
21032103 t = ind1; //return where we need to patch
21042104
2105− } else { /* VT_JMP || VT_JMPI */
2105+ } else if (v == VT_JMP || v == VT_JMPI) {
21062106 /* && or || optimization */
21072107 if ((v & 1) == inv) {
21082108 /* insert vtop->c jump list in t */
i386-gen.c+1−1
@@ -677,7 +677,7 @@ ST_FUNC int gtst(int inv, int t) · 676 unmodified lines
677677 /* fast case : can jump directly since flags are set */
678678 g(0x0f);
679679 t = psym((vtop->c.i - 16) ^ inv, t);
680− } else { /* VT_JMP || VT_JMPI */
680+ } else if (v == VT_JMP || v == VT_JMPI) {
681681 /* && or || optimization */
682682 if ((v & 1) == inv) {
683683 /* insert vtop->c jump list in t */
il-gen.c+1−1
@@ -516,7 +516,7 @@ int gtst(int inv, int t) · 515 unmodified lines
516516 break;
517517 }
518518 t = out_opj(c, t);
519− } else { /* VT_JMP || VT_JMPI */
519+ } else if (v == VT_JMP || v == VT_JMPI) {
520520 /* && or || optimization */
521521 if ((v & 1) == inv) {
522522 /* insert vtop->c jump list in t */
x86_64-gen.c+1−1
@@ -1592,7 +1592,7 @@ int gtst(int inv, int t) · 1591 unmodified lines
15921592 }
15931593 g(0x0f);
15941594 t = psym((vtop->c.i - 16) ^ inv, t);
1595− } else { /* VT_JMP || VT_JMPI */
1595+ } else if (v == VT_JMP || v == VT_JMPI) {
15961596 /* && or || optimization */
15971597 if ((v & 1) == inv) {
15981598 /* insert vtop->c jump list in t */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t