------- Comment #7 from steven at gcc dot gnu dot org 2010-02-12 22:52 ------- If arm_arm_address_cost is "fixed" to return 1 unconditionally, the expected code of comment #5 comes out at -Os, with the bonus of one less branch:
testme: ldr r2, .L4 ldr r1, .L4+4 sub r3, r2, #400 .L2: ldr r0, [r1], #4 str r0, [r3], #4 cmp r3, r2 bne .L2 bx lr This is actually a regression from GCC 3.4.6. -- steven at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rearnsha at gcc dot gnu dot | |org Component|middle-end |target GCC target triplet|arm-elf-unknown |arm-elf, arm-eabi Known to fail| |4.4.0 4.5.0 Known to work| |3.4.6 Summary|ARM optimizer produces |[4.3/4.4/4.5 Regression] ARM |severely suboptimal code |optimizer produces severely | |suboptimal code http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27016