Merge pull request #165 from davidgiven/dtrg-b164

i80: fix bad code in inl using faddrn
This commit is contained in:
David Given 2019-02-14 23:29:41 +01:00 committed by GitHub
commit 0694cf34b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 3 deletions

View file

@ -954,7 +954,7 @@ pat inc
inx %1
yields %1
pat inl ($1>0) && ($1<STACKHELPERS)
pat inl ($1>0) && ($1<=STACKHELPERS)
uses hlreg
gen
Call {plabel, ".faddr", $1}
@ -964,10 +964,10 @@ pat inl ($1>0) && ($1<STACKHELPERS)
inr {m}
1:
pat inl ($1<0) && ($1<0-STACKHELPERS)
pat inl ($1<0) && ($1>=0-STACKHELPERS)
uses hlreg
gen
Call {plabel, ".faddrn", $1}
Call {plabel, ".faddrn", 0-$1}
inr {m}
jnz {label,1f}
inx hl

View 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;
}