– 72 – Forcing Conditional Cannot use conditional move when either outcome has side effect int cnt_gt = 0; int cnt_le = 0; int choose_cond(int x, int y) { int result; if (x > y) { result = ++cnt_gt; } else { result = ++cnt_le; } return result; } choose_cond: cmpl %esi, %edi jle.L8 movl cnt_gt(%rip), %eax incl %eax movl %eax, cnt_gt(%rip) ret.L8: movl cnt_le(%rip), %eax incl %eax movl %eax, cnt_le(%rip) ret If Then Else
{}