bebbo / gcc

Bebbo's gcc-6-branch for m68k-amigaos
GNU General Public License v2.0
33 stars 11 forks source link

POSSIBLE OPTIMIZATION : could adjacent CLR be merged? #223

Closed GunnarVB closed 4 months ago

GunnarVB commented 7 months ago

Hello Stefan,

could you please add a "peephole" which enabled GCC to merge two CLR.W operations? I see very often in code, the clearing of structures.

void test (short * ptr)
{  
  ptr[10]=0;
  ptr[11]=0;
} 

The result in this assembly today:

_test:
        clr.w (20,a0)
        clr.w (22,a0)
        rts

It would be sweet if GCC would instead do CLR.L

Thank you very much