From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <5ba07285c54fa7e0fde7a02e3a09bdbc@rei2.9hal> Date: Mon, 29 Apr 2013 20:53:34 +0200 From: cinap_lenrek@gmx.de To: 9fans@9fans.net In-Reply-To: <1367214858.517e0b0a4dbc3@www.imp.polymtl.ca> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] 5l bug Topicbox-Message-UUID: 4b0e6bc8-ead8-11e9-9d60-3106f5b1d025 following up, theres my naive fix for this. instead of emiting conditional division instruction by 5c... dont and keep the branch. does this make any sense? term% hg diff -r 1777 peep.c diff -r 5eeb36d3ddd0 sys/src/cmd/5c/peep.c --- a/sys/src/cmd/5c/peep.c Mon Jul 30 19:11:16 2012 +0200 +++ b/sys/src/cmd/5c/peep.c Mon Apr 29 20:51:12 2013 +0200 @@ -1354,6 +1354,15 @@ j->end = r->s2; return Branch; } + switch(r->prog->as){ + case ADIV: + case ADIVU: + case AMOD: + case AMODU: + /* emulated by 5l, doesnt handle conditionals */ + j->end = r->s1; + return Toolong; + } if (modifiescpsr(r->prog)) { j->end = r->s1; return Setcond; -- cinap