https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47186
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Looks to be fixed in 5.1+.
5.1-7.3 produces:
.L2:
call rand
addl $4, %ebx
movl %eax, -4(%ebx)
cmpl $mike+400, %ebx
jne .L2
8.1+ produces
.L2:
call rand
movl %eax, mike(,%ebx,4)
addl $1, %ebx
cmpl $100, %ebx
jne .L2