------- Comment #12 from carrot at google dot com 2010-01-11 08:55 ------- (In reply to comment #11) > Yes, I would have expected the block starting with .L4 to be *after* > the block starting with .L5, something like so: > > iterate: > push {lr} > ldr r3, [r1] > .L6: > str r3, [r0] > sub r2, r3, #0 > beq .L3 > .L5: > ldr r1, [r3, #4] > cmp r1, #0 > bne .L3 > ldr r3, [r3, #8] > b .L6 > .L3: > str r2, [r0, #12] > @ sp needed for prologue > pop {pc} > > Does that look correct? And if so, could you see if there is an open > bug report about this; or otherwise file a new PR and add me to the > CC-list? >
It is correct. The basic block ordering issue (-Os) has been observed several times. Following are related PRs: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41004 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41396 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40730