Crash when creating a variable.
char coef_up[] = {
0x04,0x00, 0x03,0x00, 0x02,0x00, 0x00,0x00, 0xFE,0x0F, 0xFA,0x0F, 0xF6,0x0F, 0xF2,0x0F,
0xEC,0x0F, 0xE6,0x0F, 0xE0,0x0F, 0xD9,0x0F, 0xD2,0x0F, 0xCA,0x0F, 0xC3,0x0F, 0xBB,0x0F,
0xCA,0x0F, 0xE0,0x0F, 0xF7,0x0F, 0x13,0x00, 0x31,0x00, 0x54,0x00, 0x78,0x00, 0xA1,0x00,
0xCB,0x00, 0xFA,0x00, 0x28,0x01, 0x5B,0x01, 0x8D,0x01, 0xC3,0x01, 0xF7,0x01, 0x2E,0x02,
0x79,0x04, 0x72,0x04, 0x68,0x04, 0x55,0x04, 0x40,0x04, 0x25,0x04, 0x07,0x04, 0xE2,0x03,
0xBD,0x03, 0x91,0x03, 0x65,0x03, 0x34,0x03, 0x03,0x03, 0xCE,0x02, 0x99,0x02, 0x63,0x02,
0xB9,0x0F, 0xAB,0x0F, 0x9F,0x0F, 0x98,0x0F, 0x91,0x0F, 0x8D,0x0F, 0x8B,0x0F, 0x8B,0x0F,
0x8C,0x0F, 0x8F,0x0F, 0x93,0x0F, 0x98,0x0F, 0x9E,0x0F, 0xA5,0x0F, 0xAD,0x0F, 0xB4,0x0F,
};
C:\firmware_rtd2660\bug1>sdcc -v
SDCC : mcs51/z80/z180/r2k/r2ka/r3ka/sm83/tlcs90/ez80_z80/z80n/r800/ds390/pic16/p
ic14/TININative/ds400/hc08/s08/stm8/pdk13/pdk14/pdk15/mos6502/mos65c02/f8 TD- 4.
5.1 #15257 (MINGW64)
published under GNU General Public License (GPL)
C:\firmware_rtd2660\bug1>sdcc -mmcs51 --opt-code-size --fverbose-asm -c -o main.
rel main.c
main.c:1: warning 84: 'auto' variable 'iTemp254' may be used before initializati
on
main.c:1: error 9: FATAL Compiler Internal Error in file '/home/sdcc-builder/bui
ld/sdcc-build/orig/sdcc/src/SDCCmem.c' line number '1292' : code generator inter
nal error
Contact Author with source code
Caught signal 11: SIGSEGV
IIRC, when no address space is specified, the MCS-51 target defaults to the small memory model with up to 128 or 256 bytes of "internal" RAM for all data.
Squeezing a 128 byte array in there is a really a tight fit.
Are you intentionally using the small memory model?
Granted, even if it doesn't fit, you should still get a proper error message and not a segmentation fault.
Yes, I know that the variable won't fit there. I just happened to stumble upon a segmentation fault.