Confirmed the bug is present with vanilla sdcc r14648. $ sdcc -v SDCC : z80/z180/r2ka/r3ka/sm83/ez80_z80/z80n/r800 TD- 4.4.0 #14620 (Linux) published under GNU General Public License (GPL) $ sdcc -S bug-2635.c bug-2635.c:29: error 9: FATAL Compiler Internal Error in file 'SDCCopt.c' line number '312' : 0 Found bug is gone with sdcc r15078 $ sdcc -v SDCC : z80/z180/r2ka/r3ka/sm83/ez80_z80/z80n/r800/f8 TD- 4.4.4 #15078 (Linux) published under GNU General Public License (GPL) $ sdcc -S bug-2635.c This...
Confirmed the bug is present with sdcc r14648. $ sdcc -v SDCC : z80/z180/r2ka/r3ka/sm83/ez80_z80/z80n/r800 TD- 4.4.0 #14620 (Linux) published under GNU General Public License (GPL) $ sdcc -S bug-2635.c bug-2635.c:29: error 9: FATAL Compiler Internal Error in file 'SDCCopt.c' line number '312' : 0 Found bug is gone with sdcc r15078 $ sdcc -v SDCC : z80/z180/r2ka/r3ka/sm83/ez80_z80/z80n/r800/f8 TD- 4.4.4 #15078 (Linux) published under GNU General Public License (GPL) $ sdcc -S bug-2635.c This issue...
Simplifying and working on this a bit further, the issue seems to be related to the casting of uint8_t to int16_t and then to float. bug-2635.c:29: error 9: FATAL Compiler Internal Error in file 'SDCCopt.c' line number '312' : 0 Contact Author with source code The error does not occur in test_b case where the cast to float is done directly. // zcc +zxn -S -O0 -SO0 bug-2635.c // zcc +zx -compiler=sdcc -S -O0 -SO0 bug-2635.c #include <stdint.h> uint8_t IntNorms[4] = {0x1F, 0x00, 0x3E, 0x1F}; float...
Simplifying and working on this a bit further, the issue seems to be related to the promotion of uint8_t to int16_t and then directly to float. bug-2635.c:29: error 9: FATAL Compiler Internal Error in file 'SDCCopt.c' line number '312' : 0 Contact Author with source code The error does not occur in test_b case. // zcc +zxn -S -O0 -SO0 bug-2635.c // zcc +zx -compiler=sdcc -S -O0 -SO0 bug-2635.c #include <stdint.h> uint8_t IntNorms[4] = {0x1F, 0x00, 0x3E, 0x1F}; float test_a; float test_b; void main(void)...
Simplifying and working on this a bit further, the issue seems to be related to the promotion of uint8_t to int16_t and then directly to float. The error does not occur in test_b case. // zcc +zxn -S -O0 -SO0 bug-2635.c // zcc +zx -compiler=sdcc -S -O0 -SO0 bug-2635.c #include <stdint.h> uint8_t IntNorms[4] = {0x1F, 0x00, 0x3E, 0x1F}; float test_a; float test_b; void main(void) { uint8_t i = 0; int16_t value16x; while (i < 2) { value16x = (int16_t)IntNorms[i]; test_a = (float)value16x; // test_b...
Environment is with z88dk, and the sdcc version is v4.4.0, release r14648. This issue may have been repaired since r14648, and if so we can close this and move on. I have dug into it a bit deeper (returned from AFK), and found this seems to be easily reproducible across a variety of z80 family machine types and optimisation levels. My only thought is that since we're using UCPP as a preprocessor something is going wrong at that point, before it gets to SDCC. I'll dig in there shortly. EDIT the .i...
Environment is with z88dk, and the sdcc version is v4.4.0, release r14648. This issue may have been repaired since r14648, and if so we can close this and move on. I have dug into it a bit deeper (returned from AFK), and found this seems to be easily reproducible across a variety of z80 family machine types and optimisation levels. My only thought is that since we're using UCPP as a preprocessor something is going wrong at that point, before it gets to SDCC. I'll dig in there shortly. EDIT the .i...
Environment is with z88dk, and the sdcc version is v4.4.0, release r14648. This issue may have been repaired since r14648, and if so we can close this and move on. I have dug into it a bit deeper (returned from AFK), and found this seems to be easily reproducible across a variety of z80 family machine types and optimisation levels. My only thought is that since we're using UCPP as a preprocessor something is going wrong at that point, before it gets to SDCC. I'll dig in there shortly. Default configuration...