Merge pull request #165 from davidgiven/dtrg-b164
i80: fix bad code in inl using faddrn
This commit is contained in:
commit
0694cf34b0
2 changed files with 19 additions and 3 deletions
|
@ -954,7 +954,7 @@ pat inc
|
||||||
inx %1
|
inx %1
|
||||||
yields %1
|
yields %1
|
||||||
|
|
||||||
pat inl ($1>0) && ($1<STACKHELPERS)
|
pat inl ($1>0) && ($1<=STACKHELPERS)
|
||||||
uses hlreg
|
uses hlreg
|
||||||
gen
|
gen
|
||||||
Call {plabel, ".faddr", $1}
|
Call {plabel, ".faddr", $1}
|
||||||
|
@ -964,10 +964,10 @@ pat inl ($1>0) && ($1<STACKHELPERS)
|
||||||
inr {m}
|
inr {m}
|
||||||
1:
|
1:
|
||||||
|
|
||||||
pat inl ($1<0) && ($1<0-STACKHELPERS)
|
pat inl ($1<0) && ($1>=0-STACKHELPERS)
|
||||||
uses hlreg
|
uses hlreg
|
||||||
gen
|
gen
|
||||||
Call {plabel, ".faddrn", $1}
|
Call {plabel, ".faddrn", 0-$1}
|
||||||
inr {m}
|
inr {m}
|
||||||
jnz {label,1f}
|
jnz {label,1f}
|
||||||
inx hl
|
inx hl
|
||||||
|
|
16
tests/plat/bugs/bug-164-faddrn_c.c
Normal file
16
tests/plat/bugs/bug-164-faddrn_c.c
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "test.h"
|
||||||
|
|
||||||
|
int doit(void)
|
||||||
|
{
|
||||||
|
char buf[128];
|
||||||
|
int i;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
doit();
|
||||||
|
finished();
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue