x86-64: Cast from 64bit pointer to long long must not generate movslq.

This commit is contained in:
Shinichiro Hamaji
2009-04-16 01:32:16 +09:00
committed by grischka
parent a9c78d04f2
commit be43c8e0ed
2 changed files with 11 additions and 1 deletions

2
tcc.c
View File

@ -6228,7 +6228,7 @@ static void gen_cast(CType *type)
vpop();
#else
int r = gv(RC_INT);
if (sbt != (VT_INT | VT_UNSIGNED)) {
if (sbt != (VT_INT | VT_UNSIGNED) && sbt != VT_PTR) {
/* x86_64 specific: movslq */
o(0x6348);
o(0xc0 + (REG_VALUE(r) << 3) + REG_VALUE(r));