Bugs item #3122620, was opened at 2010-11-29 20:10
Message generated for change (Settings changed) made by maartenbrock
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100599&aid=3122620&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: z80 port
>Group: fixed
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Woody (woody1234)
Assigned to: Nobody/Anonymous (nobody)
Summary: Generated incorrect result 2
Initial Comment:
Command line to compile: C:\sdcc\bugs\sips>..\..\bin\sdcc sips.c -mz80 -c --codeseg CODE5
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)
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.
I am attaching sips_2.zip which used in 6069 test.
----------------------------------------------------------------------
Comment By: Woody (woody1234)
Date: 2011-09-16 03:30
Message:
Yes, please.
----------------------------------------------------------------------
Comment By: Maarten Brock (maartenbrock)
Date: 2011-09-15 21:28
Message:
Can this be closed?
----------------------------------------------------------------------
Comment By: Woody (woody1234)
Date: 2011-07-10 03:55
Message:
Sorry for the late response, I tested it again today, and found the bug
gone with #6078, which I am using right now:
C:\sdcc\bin>sdcc -v
SDCC : mcs51/gbz80/z80/ds390/pic16/pic14/TININative/ds400/hc08 3.0.1 #6078
(Dec
7 2010) (MINGW32)
----------------------------------------------------------------------
Comment By: Philipp Klaus Krause (spth)
Date: 2011-06-29 11:48
Message:
Could you test again with current trunk?
There have been lots of changes in the Z80 backend recently.
Philipp
----------------------------------------------------------------------
Comment By: Woody (woody1234)
Date: 2010-12-02 04:59
Message:
Add --no-peep option does NOT solve the problem, still get zero pointers.
----------------------------------------------------------------------
Comment By: Philipp Klaus Krause (spth)
Date: 2010-12-01 13:17
Message:
Is this problem related to peephole optimization, i.e. does it go away,
when using the --no-peep option?
Philipp
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100599&aid=3122620&group_id=599
|