When the only way to return from a function is a conditional return somewhere in the middle of a function sdcc currently leaves an unused ret at the end of the function. The attached patch adds a peephole to remove it.
This peephole was inspired by the following function:
for(i = 0; i < SPM_MAX_SPRITES; i++)
spm_sprites_list[i] = i;
Log in to post a comment.