Very large #define definitions cause a crash.
>sdcc -v
SDCC : mcs51/z80/z180/r2k/r2ka/r3ka/sm83/tlcs90/ez80_z80/z80n/r800/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8/pdk13/pdk14/pdk15/mos6502/mos65c02/f8 TD- 4.4.3 #14976 (MINGW64)
published under GNU General Public License (GPL)
There is no
#definein there. Did you upload the right file?I'm very, very sorry.
I don't know what you want to do, but I can rewrite your example so that it produces an equivalent result without a crash, even much more: 64k nop-s could be easily generated:
These macros allow you to easily and conveniently select any delays.
I have a crash in Windows 7.
Last edit: Dmitry Kharitonov 2024-10-24
Then I still suggest you to change the macros the way I've shown so you won't have a crash. You don't need
()and__asmand__endasmappearance in C should be minimized. If you don't want to have__asmand__endasmvisible in C, but inserted with the macros then you have to create separate macros for "inside of the asm blocks" (like in my previous message) and for C:This also doesn't crash. Then you use the "no-in" nopN macros in C as, for example:
nop1024;(Still, I have to note that this approach to produce "delays" is sub-optimal, the use of loops can need much less code and still be cycle exact.)
On my Debian GNU/Linux testing on amd64 system, the segfault happens when the recursion in
nicify_diffs_morehits a stack size of 4 MB.However, ulimit -s is 8 MB by default, and increasing it to 32 MB doesn't change the behaviour either. So where does the 4 MB limit come from?
SDCC explicitly reduces the limit to 4 MB,since IMO 32K nop are not entirely unreasonable,I increased the limit to 8MB in [r15066]. Of course, now one still gets the error for 64K nop. But that amount of nop is entirely unreasonable for a 16-bit architecture, so I consider this bug fixed.
P.S.: The problem is unrelated to #define. It is about the size of the function.
Related
Commit: [r15066]