Menu ▾ ▴

#4273 FATAL Compiler .. Error ... SDCCgenconstprop.cc line 1443

open
nobody
None
other
5
3 days ago
3 days ago
bbbbbr
No

This bug has a similar error to #3998, but appears to have different triggering conditions.

SDCC nightly build with no GBDK patches: (it also manifests in older sdcc 16705)

sdcc -v
SDCC : z80/sm83/mos6502/mos65c02/huc6280 TD- 4.6.4 #17264 (Linux)
published under GNU General Public License (GPL)

Getting the following compiler error:

sdcc -msm83 -c sdcc_genconstprop_error_2.c
sdcc_genconstprop_error.c:24: warning 110: conditional flow changed by optimizer: so said EVELYN the modified DOG
sdcc_genconstprop_error.c:32: error 9: FATAL Compiler Internal Error in file 'SDCCgenconstprop.cc' line number '1443' : code generator internal error

Building with:

sdcc -msm83 -c sdcc_genconstprop_error_2.c
sdcc -mz80 -c sdcc_genconstprop_error_2.c
sdcc -mmos6502 -c sdcc_genconstprop_error_2.c

Minimal example to reproduce (from a GBDK user):

typedef struct Sprite
{
    signed char speedX;
    signed char speedY;
} Sprite;

typedef struct Player
{
    Sprite sprite;
} Player;

Player player;

void
main(void)
{
    Sprite* p_sprite = &(player.sprite);

    if (p_sprite->speedY < 0)
    {
        p_sprite->speedY += 1;

        if (p_sprite->speedY > 0)
            p_sprite->speedY = 0;
    }
    else
    {
        p_sprite->speedY -= 1;

        if (p_sprite->speedY < 0)
            p_sprite->speedY = 0;
    }
}

Discussion


Log in to post a comment.