Skip to content

Commit

Permalink
fix Issue 8497 - Regression 2.060: Bad code gen involving ubyte, tern…
Browse files Browse the repository at this point in the history
…ary operators, and shifts
  • Loading branch information
WalterBright committed Aug 5, 2012
1 parent 5953d82 commit 9b3a8aa
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/backend/cod2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1750,7 +1750,10 @@ code *cdcond(elem *e,regm_t *pretregs)
else if (v2 == -1L && !I64)
gen1(c,0x48 + reg); // DEC reg
else
genc2(c,opcode,grex | modregrmx(3,0,reg),v2); // ADD reg,v2
{ genc2(c,opcode,grex | modregrmx(3,0,reg),v2); // ADD reg,v2
if (I64 && sz1 == 1 && reg >= 4)
code_orrex(c, REX);
}
}

freenode(e21);
Expand Down Expand Up @@ -3124,7 +3127,6 @@ code *cdstrcpy(elem *e,regm_t *pretregs)
genregs(c3,0x2B,DI,CX); /* SUB DI,CX */
code_orrex(c3,rex);
genmovreg(c3,SI,DI); /* MOV SI,DI */
code_orrex(c3,rex);

/* Load DS with right value */
switch (ty2)
Expand Down Expand Up @@ -3174,9 +3176,7 @@ code *cdstrcpy(elem *e,regm_t *pretregs)
if (need_DS)
c4 = gen1(c4,0x1F); /* POP DS */
if (*pretregs)
{ c4 = genmovreg(c4,AX,DI); /* MOV AX,DI */
code_orrex(c4,rex);
}
c4 = genmovreg(c4,AX,DI); /* MOV AX,DI */
c4 = gen1(c4,0xF3); /* REP */
gen1(c4,0xA4); /* MOVSB */

Expand Down Expand Up @@ -3282,7 +3282,6 @@ code *cdmemcpy(elem *e,regm_t *pretregs)
if (*pretregs) // if need return value
{ c3 = cat(c3,getregs(mAX));
c3 = genmovreg(c3,AX,DI);
code_orrex(c3, rex);
}

if (0 && I32 && config.flags4 & CFG4speed)
Expand Down Expand Up @@ -3504,7 +3503,6 @@ code *cdmemset(elem *e,regm_t *pretregs)
if (*pretregs) // if need return value
{ c3 = getregs(mBX);
c3 = genmovreg(c3,BX,DI);
code_orrex(c3,rex);
}

c3 = cat(c3,getregs(mDI | mCX));
Expand Down

0 comments on commit 9b3a8aa

Please sign in to comment.