From: SourceForge.net <no...@so...> - 2012-06-22 11:18:46
|
Bugs item #3536902, was opened at 2012-06-21 06:53 Message generated for change (Comment added) made by spth You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=3536902&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: None >Status: Closed Resolution: None Priority: 5 Private: No Submitted By: Christophe Staïesse (chastai) >Assigned to: Philipp Klaus Krause (spth) Summary: SEGV with --reserve-regs-iy Initial Comment: Hello, The compiler crash with a SEGV when I try to compile some C files with a z80 target and the --reserve-regs-iy option. I've attached an example of source which make the compiler crash. ---------------------------------------------------------------------- >Comment By: Philipp Klaus Krause (spth) Date: 2012-06-22 04:18 Message: Fixed in revision #7953. Philipp ---------------------------------------------------------------------- Comment By: Philipp Klaus Krause (spth) Date: 2012-06-22 02:04 Message: Thanks, knowing the revision # that introduced the bug helped. It seems the special handling ot --reserve-regs-iy was lost when factoring out some port-specific stuff from the generic register allocator code. I've got two ideas for a fix, one a quick hack, which might make it into the 3.2.0 release, and a cleaner, but bigger solution that seems to be a good long-term solution. Philipp P.S.: With the quick hack, regression tests pass when using --reserve-regs-iy, except for one failing test, and do not crash the compiler any more; I'll implement the cleaner solution in a branch later today. P.P.S.: --reserve-regs-iy isn't perfect yet: For functions that use more than 128 bytes of stack space for local variables or that have more than 128 bytes of parameters, iy is still used. ---------------------------------------------------------------------- Comment By: Christophe Staïesse (chastai) Date: 2012-06-22 01:17 Message: Unfortunately, the problem persists even if you remove printf. In fact many source files makes the compiler crashes with this option. Try to compile the Z80 RTL with --reserve-regs-iy: cd device/lib/z80 rm *.rel make -k SCC='$(top_builddir)/bin/sdcc -mz80 --reserve-regs-iy' On 105 C files, 86 caused a SEGV, 3 an ABRT and only 16 compiled with success. And from the 16 .asm generated, 10 contain references to IY. if you add --oldralloc, it works fine but some .asm still contains references to IY. The problem appears on revision 7537. On 7536, the RTL compile fines with --reserve-regs-iy but there are still references to IY. Christophe. ---------------------------------------------------------------------- Comment By: Philipp Klaus Krause (spth) Date: 2012-06-21 08:37 Message: Hmm, for some reason emitCall thinks that the return value of printf() is used when using --reserve-regs-iy, and tries to assign it to a non-exisitng variable. Philipp ---------------------------------------------------------------------- Comment By: Christophe Staïesse (chastai) Date: 2012-06-21 07:02 Message: sorry I pushed on the wrong button :-) I've made a regression test and this bug occurs from revision 7537. How to reproduce this bug (I've used revision 7950): sdcc -mz80 --reserve-regs-iy reserve-regs-iy-bug.c Program received signal SIGSEGV, Segmentation fault. cheapMove (to=0x1, to_offset=0, from=0x81b5eec, from_offset=0) at gen.c:2800 2800 if (to->type == AOP_ACC && from->type == AOP_ACC && to_offset == from_offset) But when I compile it with --oldralloc, it works fine. Christophe. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=3536902&group_id=599 |