totalspectrum / spin2cpp

Tool to convert Parallax Propeller Spin code to PASM, C++ or C
Other
46 stars 17 forks source link

16 bit MUL generated where it shouldn't be #428

Closed Wuerfel21 closed 9 months ago

Wuerfel21 commented 9 months ago

I have no idea how that even happens...

unsigned short funny_function() {
    return _INA | 1;
}

int main() {
    __builtin_printf("lol: %d\n",funny_function()*0x10001u);
}

leads to

    mov arg02, ina
    or  arg02, #1
    mul arg02, ##65537

Amazing.

totalspectrum commented 9 months ago

There was a silly typo that mean the LHS was checked twice instead of checking LHS and RHS. That's fixed now, thanks.