From: <Mic...@t-...> - 2001-02-06 10:19:11
|
This is a known bug, if i remember right this has already been fixed. the latest release is V2.2.1 see SDCC website or get the latest prerelease i post to the sdcc open knowledge site. latest from yesterday michael ----- Original Message ----- From: "Dai Yuwen" <yu...@mi...> To: <sdc...@li...> Sent: Wednesday, February 07, 2001 12:29 AM Subject: [Sdcc-user] bug report > Hi, Sandeep > > I think I find a bug in SDCC. My version is 2.2.0. This is the C source: > > char i,j; > void main() > { > for (j = 0;j < 10;j++) > i++; > } > > The assembly is something like: > ... > _main: > ar2 = 0x02 > ar3 = 0x03 > ar4 = 0x04 > ar5 = 0x05 > ar6 = 0x06 > ar7 = 0x07 > ar0 = 0x00 > ar1 = 0x01 > C$mytest.c$0$1$0 ==. > ; mytest.c 0 > mov _j,#0x0a > 00103$: > C$mytest.c$5$1$1 ==. > ; mytest.c 5 > inc _i > dec _j > mov a,_j > ; Peephole 109 removed ljmp by inverse jump logic > jnz 00103$ > 00108$: > mov _j,#0x09 > 00104$: > C$mytest.c$6$1$1 ==. > XG$main$0$0 ==. > ret > .area CSEG (CODE) > > Note the value of `j' is 0x09 when the loop ends. It should be 0x10, I > think. > > Best regards, > Dai Yuwen > > > _______________________________________________ > Sdcc-user mailing list > Sdc...@li... > http://lists.sourceforge.net/lists/listinfo/sdcc-user > |