#1713 Generated incorrect result

closed-fixed
z80 port (188)
5
2010-11-28
2010-11-24
Woody
No

command line to compile: C:\sdcc\bin>sdcc sips.c -mz80 -c --codeseg CODE5
C:\sdcc\bin>sdcc -v
SDCC : mcs51/z80 3.0.1 #6066 (Nov 25 2010) (MINGW32)

This problem is complicated so I attached the whole sips.c and all include files needed.
In sips.c line 2078 to 2082
if (Sip_pCurLcb->pReqUri) free(Sip_pCurLcb->pReqUri);
Sip_pCurLcb->pReqUri = heap_save_str(pBuf);
if (Sip_pCurLcb->pInvUri) free(Sip_pCurLcb->pInvUri);
Sip_pCurLcb->pInvUri = heap_save_str(pBuf);
both Sip_pCurLcb->pInvUri and Sip_pCurLcb->pReqUri will be incorrectly set to 0 in real run.
However, if rearrange them to:
if (Sip_pCurLcb->pReqUri) free(Sip_pCurLcb->pReqUri);
if (Sip_pCurLcb->pInvUri) free(Sip_pCurLcb->pInvUri);
Sip_pCurLcb->pReqUri = heap_save_str(pBuf);
Sip_pCurLcb->pInvUri = heap_save_str(pBuf);
We can get correct none-zero pointers.

Discussion

  • Woody

    Woody - 2010-11-24
     
  • Woody

    Woody - 2010-11-24

    sips.c will output "sips.asm:13264: Error: <a> machine specific addressing or addressing mode erro removing sips.rel" if using current snapshot, this is because of the jp-to-jr optimize problem. Need to change SDCCpeeph.c 2 "127" lines to "112" to compile.

     
  • Philipp Klaus Krause

    • assigned_to: nobody --> spth
    • status: open --> closed-fixed
     
  • Philipp Klaus Krause

    Fixed in rev. #6068.

    Cause of problem: Sometimes sdcc incorrectly calculated the code size of ld hl, (nn) as 1 instead of 3.

    Philipp

     
  • Woody

    Woody - 2010-11-29

    The jp to jr problem is fixed. But the zero points results are still there. I am testing snapshot build 6069 downloaded directly
    C:\sdcc\bugs\sips>..\..\bin\sdcc -v
    SDCC : mcs51/gbz80/z80/ds390/pic16/pic14/TININative/ds400/hc08 3.0.1 #6069 (Nov
    29 2010) (MINGW32)
    I am attaching sips_2.zip which used in 6069 test.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks