From: SourceForge.net <no...@so...> - 2010-08-04 14:05:16
|
Bugs item #1994062, was opened at 2008-06-14 21:12 Message generated for change (Settings changed) made by maartenbrock You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1994062&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: C-Front End >Group: fixed >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Andy (hal42usa) >Assigned to: Maarten Brock (maartenbrock) Summary: pointer compare wrongly done with signed math Initial Comment: mcs51 port: pointer compares are done with signed logic (attested to by 'xrl a,#80'), which is usually not a problem with xdata pointers since xdata space is usually only 1k, but is a disaster with idata pointers. I have the source compiling with VS2005, but am having trouble figuring out where pointers are getting tagged as signed. ---------------------------------------------------------------------- >Comment By: Maarten Brock (maartenbrock) Date: 2010-08-04 16:05 Message: Fixed both signed and xdata bug in SDCC 2.9.7 #5909. Also added requested optimization. 1458678 was not related. ---------------------------------------------------------------------- Comment By: Patryk (patryks) Date: 2008-06-16 15:21 Message: Logged In: YES user_id=1788180 Originator: NO Maybe related to pointer/value constness (long standing SDCC problem): [ 1458678 ] unsigned long *const w, xtea stream cypher ---------------------------------------------------------------------- Comment By: Maarten Brock (maartenbrock) Date: 2008-06-16 11:31 Message: Logged In: YES user_id=888171 Originator: NO It's worse. If you have the pointers point toward unsigned char's the compiler uses unsigned math. Or if you move everything to xdata this assignment fails. char xdata *one; char xdata *two; two = &one[140]; error 47: indirections to different types assignment from type 'unsigned-char near* ' to type 'unsigned-char xdata* ' ---------------------------------------------------------------------- Comment By: Andy (hal42usa) Date: 2008-06-14 22:52 Message: Logged In: YES user_id=2117929 Originator: YES getting closer, the compiler is comparing the pointers as bytes that are neither specifically signed or unsigned. I will try 'default char type unsigned' as a compiler switch ... yep, that fixes it, as a workaround. Now if I could find where the compiler decides to treat idata pointers as default chars I could fix this for real. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1994062&group_id=599 |