Take: unsigned f(unsigned low32, unsigned *tmpA, unsigned prevBestA) { unsigned t = *tmpA; if ((low32 > prevBestA ) && (!t)) prevBestA = low32; return prevBestA; } ---- CUT --- Currently we get: sltu $2,$6,$4 beq $2,$0,$L2 lw $3,0($5)
move $2,$4 movz $6,$2,$3 $L2: j $31 move $2,$6 But we should be able to have no branches in this case and only one conditional move. I checked the spu-elf target and noticed there are no branches there so the middle-end is able to do it. -- Summary: branches in conditional move code Product: gcc Version: 4.5.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org GCC target triplet: mips64-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43181