Seems it was actually fixed in 14650. So this ticket can be closed. There still seems to be a problem with case 3 generating a 16-bit sequence that seems redundant to me, given that the two input variables and the function parameter are all 8-bit. But that's not a functional bug - just a possible optimization, assuming the compiler can predict this.
Case 3 in the above (the actual failing case) was a bit incorrect/badly formatted, but I can't edit the ticket. It should say: Whereas case 3 generates a very long sequence of instructions, where the value of the "lda y" gets immediately overwritten by a "ldx #0x00 / txa" pair: 295 ; src/x_and_not_y.c: 62: print_hex(XANDNOTY_MACRO()); 00C5A4 AD 01 03 [ 4] 296 lda _y 00C5A7 A2 00 [ 2] 297 ldx #0x00 00C5A9 8A [ 2] 298 txa 00C5AA 49 FF [ 2] 299 eor #0xff 00C5AC 85 2F [ 3] 300 sta (_main_sloc0_1_0 +...
Patch to make missing .lst file during .rst file creation cause a warning instead of error
MOS6502 code generation incorrect for expression "x & ~y"
Ah, ok. That's fair enough. Do you happen to know who the best person to ask for 6502-related patch reviews might be? Kind Regards, Michel On Monday, January 30, 2023, 07:10:43 AM GMT, Philipp Klaus Krause spth@users.sourceforge.net wrote: No. I'm not really familiar with 6502 or the assembler/linker. I've worked on the peephole optimizer enough that I felt confident to apply this patch, despite it being for mos6502; but the mos6502 linker is something someone familiar with the assembler/linker or...
Hi Philipp, Thank you for finally merging this fix! Do you think you might be able to have a look at https://sourceforge.net/p/sdcc/patches/436/ as well? It's also been pending for very long now... and having 6502 have the same 24bit address format as other build targets would really simplify my gbdk-2020 work :) Kind Regards, Michel On Saturday, January 21, 2023, 02:25:09 PM GMT, Philipp Klaus Krause spth@users.sourceforge.net wrote: status: open --> closed-accepted assigned_to: Philipp Klaus Krause...
mos6502 24bit address
mos6502 peephole optimizer bugfix