description:
Compiling the attached code with sdcc produces a FATAL Compiler Internal Error:
main.c:644: error 9: FATAL Compiler Internal Error in file '/home/sdcc-builder/build/sdcc-build/orig/sdcc/src/stm8/peep.c' line number '89' : readint() got non-integer argument:
Contact Author with source code
A
A
A
A
A
A
A
A
A
A
A
A
A
A
command line:
sdcc -mstm8 -o "." --std-c99 -c "main.c"
sdcc version:
The fault occurs with sdcc Version V4.1.0 when using sdcc-4.1.0-x64-setup.exe on a windows 10 64-bit operating system. I have tested it against V3.6.0 which works fine without any issues.
SDCC : mcs51/z80/z180/r2k/r2ka/r3ka/gbz80/tlcs90/ez80_z80/z80n/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8/pdk13/pdk14/pdk15 4.1.0 #12072 (MINGW64)
published under GNU General Public License (GPL)
I can reproduce the issue using current SDCC 4.1.10 #12685 on Debian GNU/Linux testing.
The attached main-minimal.c reproduces the bug, and is much shorter than main.c.
Looks like the issue is triggered by the use of upper-case for the inline assembler code in STARTUP_SWIM_DELAY_5S followed by a function call for which tail-call optimization optimized a call/ret sequence to jmp.
Self-contained sample to reproduce (the issue still exists in current trunk):
Fixed in [r15573].
Related
Commit: [r15573]