Description
Reported by @haberman
Consider:
typedef void Func(void *table, long idx);
void ExtraMov(Func** table, long idx) {
return table[idx](table, idx);
}
Actual output:
ExtraMov(void (**)(void*, long), long):
mov rax, qword ptr [rdi + 8*rsi]
jmp rax
Desired output:
ExtraMov(void (**)(void*, long), long):
jmp qword ptr [rdi + 8*rsi]
(GCC can do it: https://godbolt.org/z/73rGW9M45)
(For 32-bit x86 we get it right, but only for -fno-pic; for -fpic we get confused: https://godbolt.org/z/1e9s787Gr)