#96 Z80 return peephole

closed-accepted
None
5
2008-02-16
2008-01-26
No

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.

Philipp

P.S.:
This peephole was inspired by the following function:

void spm_init(void)
{
spm_sprite i;
for(i = 0; i < SPM_MAX_SPRITES; i++)
{
cvu_set_sprite_y(spm_get_sprite(i), 207);
spm_sprites_list[i] = i;
}
}

Discussion

  • Borut Ražem

    Borut Ražem - 2008-02-16
    • assigned_to: nobody --> borutr
    • status: open --> closed-accepted
     
  • Borut Ražem

    Borut Ražem - 2008-02-16

    Logged In: YES
    user_id=568035
    Originator: NO

    Patch applied in svn revision #5012.

    Borut

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks