This bug might be the same as #1812570.
A small sample is attached.
On gcc f() return 1.
Logged In: YES
Sorry, I accidently hit the submit button.
On sdcc there's an additional indirection. Instead of returning the expected value sdcc treats the expected value and whatever byte might be next as a pointer and the value it points to.
Here's the generated asm (using sdcc -mz80 --fverbose-asm test.c):
ld h,b #_y NOW IN HL
ld c,(hl) 1 NOW IN C
While I use the Z80 port this probably affects all ports.
File Added: test.asm
I can confirm this bug is present for mcs51 too.
Fixed in SDCC 2.9.7 #5903.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.