bebbo / gcc

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

(A0)+ not always used as expected #221

Closed GunnarVB closed 7 months ago

GunnarVB commented 7 months ago

Hello Stefan,

I did some tests of your new GCC impovements I saw following:

void memclr (int length, int * ptr)
{
 for(;length--;){
   *ptr++= 0;
   *ptr++= 0; 
 }
}

==>

_memclr:
        jra .L2
.L3:
        clr.q (a0)+
.L2:
        dbral d0,.L3
        rts

-- This is excellent!! Great result! Thank you!

But I also found this:

void memclr (int length, int * ptr)
{
 for(;length--;){
   *ptr++= 0;
   *ptr++= 0;
   *ptr++= 0;
   *ptr++= 0;   
 }
}

==>

_memclr:
        jra .L2
.L3:
        clr.l (a0)+
        clr.q (a0)
        lea (12,a0),a0
        clr.l (-4,a0)
.L2:
        dbral d0,.L3
        rts

What happened here? I would have likes to see this here:

        clr.q (a0)+
        clr.q (a0)+

--

Can you fix this? Please

bebbo commented 7 months ago

http://franke.ms/cex/z/jY6a8h

GunnarVB commented 7 months ago

The result is very nice now!

Thank you very much!!