Open
Description
Bugzilla Link | 49552 |
Version | trunk |
OS | All |
CC | @topperc,@RKSimon,@phoebewang,@rotateright |
Extended Description
inline int test(char a, char b)
{
#ifndef NO_SELECT
return a < b ? -1 : a > b ? 1 : 0;
#else
if (a < b) return -1;
if (a > b) return 1;
return 0;
#endif
}
void fl();
void fe();
void fg();
void foo(char a, char b)
{
switch (test(a, b)) {
case -1: return fl();
case 0: return fe();
case 1: return fg();
}
}
; -DNO_SELECT
foo(char, char):
cmp dil, sil
jge .LBB0_1
jmp fl()
.LBB0_1:
jle .LBB0_4
jmp fg()
.LBB0_4:
jmp fe()
;
foo(char, char):
xor ecx, ecx
cmp dil, sil
setg cl
mov eax, -1
cmovge eax, ecx
cmp eax, 1
je .LBB0_5
test eax, eax
je .LBB0_4
cmp eax, -1
jne .LBB0_6
jmp fl()
.LBB0_5:
jmp fg()
.LBB0_4:
jmp fe()
.LBB0_6:
ret