From: SourceForge.net <no...@so...> - 2006-01-17 10:16:41
|
Bugs item #1408066, was opened at 2006-01-17 11:16 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1408066&group_id=599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: assembler Group: None Status: Open Resolution: None Priority: 5 Submitted By: martin (martin_h) Assigned to: Nobody/Anonymous (nobody) Summary: branch error when using !! Initial Comment: The code: ----------------------- sfr at 0x91 EXIF; void main(void) { while(!(!!(EXIF & 0x10))); } ------------------------ generates the .asm file: ------------------------ ... _main: ar2 = 0x02 ar3 = 0x03 ar4 = 0x04 ar5 = 0x05 ar6 = 0x06 ar7 = 0x07 ar0 = 0x00 ar1 = 0x01 ;bug.c:5: while(!(!!(EXIF & 0x10))); 00101$: ; genAnd mov a,_EXIF ; genIfxJump ; Peephole 108.e removed ljmp by inverse jump logic jb acc.4,00101$ ; Peephole 300 removed redundant label 00107$ ; Peephole 300 removed redundant label 00104$ ret .area CSEG (CODE) .area CONST (CODE) .area XINIT (CODE) ------------------------ The jb should be a jnb. If the code is changed to: ------------------------ sfr at 0x91 EXIF; void main(void) { while(!((EXIF & 0x10))); } ------------------------ which should generate the same result the correct .asm file is generated (with a jnb). Compile line: sdcc --iram-size 128 --xram-size 0x800 --code-size 0x8000 -c bug.c Sdcc version used (I have tried 2.5.0 with the same result): mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.5.4 #1191 (Jan 8 2006) (MINGW32) Thanks! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1408066&group_id=599 |