From: SourceForge.net <no...@so...> - 2003-02-04 22:05:36
|
Bugs item #613998, was opened at 2002-09-24 20:21 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=613998&group_id=599 Category: C-Front End Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jesus Calvino-Fraga (jesusc) Assigned to: Johan Knol (johanknol) Summary: Crash or bad code in Win98. Ok in WinXP. Initial Comment: When compiling the file 'parse.c' (sdcc -c parse.c) sdcc crashes or generates bad code on Windows 95/98 but works ok in Windows 2k/XP. Adding or removing random code in 'parse.c' will cause sdcc to crash, generate wrong code, or even generate correct code under Windows 95/98. When line 'char j=0;' is commented out in 'parse.c' sdcc was crashing in my Windows 98 machine, but it may just generate bad code in Windows 95. I am using the latest CVS sources compiled with Visual C++ 6.0. I used the same executable when testing on the four machines. It doesn't matter if I build sdcc on any of the four machines the result is the same. When sdcc crashes it points to either sdcc\src\SDCCloop.c:214 or sdcc\src\SDCCloop.c:216: int findLoopEndSeq (region * lreg) { eBBlock *block; eBBlock *lblock; for (block = lblock = setFirstItem (lreg->regBlocks); block; block = setNextItem (lreg->regBlocks)) { if (block != lblock && block->lSeq > lblock->lSeq) <-- CRASHES HERE lblock = block; } return lblock->lSeq <-- OR CRASHES HERE } And the problem is that either block or lblock are invalid, for example lblock=0x00000194. I am also including the asm listing when compiling in Windows 98 and Windows XP, in one of the many occasions where the generated code was different. If I change the code in SDCCloop.c so that it checks for block and lblock to be larger than (eBBlock *)0x1000 sdcc doesn't crash but it generates bad code. ---------------------------------------------------------------------- >Comment By: Johan Knol (johanknol) Date: 2003-02-04 22:11 Message: Logged In: YES user_id=63512 I can't reproduce the crash, and diffing the two asm's doesn't help much either. Please point me at where in the c and asm file it goes wrong (it's too long to reverse engineer :), there should be other symtoms as well in the dumpfiles. These are the most difficult bugs to find, really. Most likely an enum that starts at 0, so: uninitialized equals zero where it should be undefined! Johan (how about rewriting sdcc in c++ :) ---------------------------------------------------------------------- Comment By: Jesus Calvino-Fraga (jesusc) Date: 2003-02-04 21:06 Message: Logged In: YES user_id=603650 The problem still exists. ---------------------------------------------------------------------- Comment By: Johan Knol (johanknol) Date: 2003-02-04 18:10 Message: Logged In: YES user_id=63512 I think my fix for bug #631653 fixed this too. If you can confirm, please close the bug. Johan ---------------------------------------------------------------------- Comment By: Jesus Calvino-Fraga (jesusc) Date: 2003-01-27 17:52 Message: Logged In: YES user_id=603650 Yes, it still exists. The debugger breaks at SDCCloop.c:218. ---------------------------------------------------------------------- Comment By: Johan Knol (johanknol) Date: 2003-01-27 09:47 Message: Logged In: YES user_id=63512 Can you confirm this still exists in latest cvs? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=613998&group_id=599 |