------- Comment #1 from ramana at gcc dot gnu dot org 2010-01-04 23:44 ------- For completeness the options are with -mthumb -Os -march=armv5te ?
With trunk I see a size of 52 bytes and this code. .type test, %function test: push {r4, r5, r6, r7, lr} sub sp, sp, #12 mov r7, r0 str r1, [sp, #4] mov r6, r2 mov r5, #0 b .L2 .L4: add r4, r7, r5 ldr r0, [r4, #4] bl func sub r6, r6, #1 cmp r0, #0 beq .L5 ldr r1, [sp, #4] add r3, r1, r5 ldmia r4!, {r1, r2} stmia r3!, {r1, r2} add r5, r5, #8 .L2: cmp r6, #0 bne .L4 mov r0, #1 b .L3 .L5: mov r0, #0 .L3: add sp, sp, #12 @ sp needed for prologue pop {r4, r5, r6, r7, pc} .size test, .-test -- ramana at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Known to fail| |4.4.0 4.5.0 Known to work| |4.2.1 Last reconfirmed|0000-00-00 00:00:00 |2010-01-04 23:44:35 date| | Summary|loop canonicalization causes|[4.4 / 4.5 regression] loop |a lot of unnecessary |canonicalization causes a |temporary variables |lot of unnecessary temporary | |variables http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42505