bebbo / gcc

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

Adding a value to array elements in a for/while loop gives worse code than expected. #143

Closed RMortenB closed 3 years ago

RMortenB commented 3 years ago

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

Expected was something like

_inc_array:
        move.l (4,sp),
        moveq #99,d0
        moveq #1,d1
.L2:
        add.l d1,(a0)+
        dbra d0,.L2
        rts

or similar.

arczi84 commented 3 years ago

Sonic FPS report:

gcc version 6.5.0b: 210210074436 - 63.5 fps 210214172924 - 60.8 fps