------- Comment #7 from steven at gcc dot gnu dot org 2010-01-29 23:11 ------- Created an attachment (id=19755) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19755&action=view) Hack to look for invariants inside MEMs
Re. comment #4: The following code would also be correct, right? test: push {r4, lr} sub sp, sp, #8 mov r3, #0 add r4, sp, #4 str r3, [sp, #4] .L2: mov r0, r4 bl func ldr r3, [r4] cmp r3, #12 ble .L2 add sp, sp, #8 @ sp needed for prologue pop {r4, pc} .size test, .-test .ident "GCC: (GNU) 4.5.0 20100129 (experimental) [trunk revision 156352]" I have a really bad hack that makes loop-invariant look at addresses inside MEMs (attached). (Looking at Zdenek:) Would something like this in a more polished and actually verified&tested form be a good idea? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39837