PIC16 compilation of
support/regression/fwk/lib/testfwk.c fails:
../../../sdcc/support/regression/fwk/lib/testfwk.c:121:
error 9: FATAL Compiler Internal Error in file
'../../../../sdcc_all/sdcc/src/pic16/ralloc.c' line
number '1110' : allocWithIdx not found
Contact Author with source code
To reproduce it go to the sdcc/support/regression
directory, comment out the .SLIENT: line from Makefile
and execute:
make test-pic16
This is a very nasty bug which prevent to run PIC16
regression test, so I set the priority to 7. It should
be fixed ASAP or the release 2.6.0 will be dalayed.
sdcc version:
SDCC :
mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08
2.5.6 #0 (Apr 28 2006) (UNIX)
Borut
Patch part 1 for the bug (in ralloc.c)---hides the real error!
Logged In: YES
user_id=1115835
This bug needs to be fixed in src/pic16/ralloc.c
(pic16_allocWithIdx) to create a new register with the
desired index---I have done this already, patch attached.
The more serious error is in src/pic16/gen.c (aopForSym):
The final 'else' branch within the 'if (sym->onStack) {}'
block allocates space on the stack indirectly via
pic16_popGetTempRegCond, which pushes variables onto the stack.
The stack is cleaned up at the end of the surrounding
function, but the allocation might be placed within loops
(as is in testfwk.c; the a switch() statement causes the
allocation).
This results in a stack corruption even if the ralloc.c is
fixed; so I do not commit it, not to hide the bug.
We need a way to move the allocation from within aopForSym()
to the beginning of each function. Any ideas?
Regards,
Raphael
Logged In: YES
user_id=770505
Perhaps we can solve this bug by restoring
stack at the end of the switch{} statement.
Raphael, let me take a look at this...
I might take some time, but I want to see if
I can do anything...
regards,
Vangelis
Logged In: YES
user_id=770505
Should been fixed in version SDCC v2.5.6 #4160