diff --git a/compiler/x86/itcpugas.pas b/compiler/x86/itcpugas.pas index fe41d324f6..4280245f4d 100644 --- a/compiler/x86/itcpugas.pas +++ b/compiler/x86/itcpugas.pas @@ -60,10 +60,10 @@ interface '','BW','BL','WL','BQ','WQ',{'LQ',}'B','W','L','S','Q','T' ); att_sizesuffix : array[0..11] of topsize = ( - S_NO,S_BW,S_BL,S_WL,S_BQ,S_WQ,{S_LQ,}S_B,S_W,S_L,S_FS,S_IQ,S_FX + S_NO,S_BW,S_BL,S_WL,S_BQ,S_WQ,{S_LQ,}S_B,S_W,S_L,S_NO,S_Q,S_NO ); att_sizefpusuffix : array[0..11] of topsize = ( - S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,{S_NO,}S_NO,S_NO,S_FL,S_FS,S_IQ,S_FX + S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,{S_NO,}S_NO,S_NO,S_FL,S_FS,S_NO,S_FX ); att_sizefpuintsuffix : array[0..11] of topsize = ( S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,{S_NO,}S_NO,S_NO,S_IL,S_IS,S_IQ,S_NO @@ -83,10 +83,10 @@ interface '','BW','BL','WL','B','W','L','S','Q','T' ); att_sizesuffix : array[0..9] of topsize = ( - S_NO,S_BW,S_BL,S_WL,S_B,S_W,S_L,S_FS,S_IQ,S_FX + S_NO,S_BW,S_BL,S_WL,S_B,S_W,S_L,S_NO,S_NO,S_NO ); att_sizefpusuffix : array[0..9] of topsize = ( - S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_FL,S_FS,S_IQ,S_FX + S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_FL,S_FS,S_NO,S_FX ); att_sizefpuintsuffix : array[0..9] of topsize = ( S_NO,S_NO,S_NO,S_NO,S_NO,S_NO,S_IL,S_IS,S_IQ,S_NO diff --git a/compiler/x86/rax86att.pas b/compiler/x86/rax86att.pas index 84c5ac38a1..f4a6724dc7 100644 --- a/compiler/x86/rax86att.pas +++ b/compiler/x86/rax86att.pas @@ -798,9 +798,13 @@ Implementation actopsize:=att_sizefpuintsuffix[sufidx] else actopsize:=att_sizesuffix[sufidx]; - actasmtoken:=AS_OPCODE; - is_asmopcode:=TRUE; - exit; + { only accept suffix from the same category that the opcode belongs to } + if (actopsize<>S_NO) or (suflen=0) then + begin + actasmtoken:=AS_OPCODE; + is_asmopcode:=TRUE; + exit; + end; end; end; { not found, check condition opcodes } @@ -822,10 +826,14 @@ Implementation actopsize:=att_sizefpuintsuffix[sufidx] else actopsize:=att_sizesuffix[sufidx]; - actcondition:=cnd; - actasmtoken:=AS_OPCODE; - is_asmopcode:=TRUE; - exit; + { only accept suffix from the same category that the opcode belongs to } + if (actopsize<>S_NO) or (suflen=0) then + begin + actcondition:=cnd; + actasmtoken:=AS_OPCODE; + is_asmopcode:=TRUE; + exit; + end; end; end; end; diff --git a/tests/tbs/tb0267.pp b/tests/tbs/tb0267.pp index db435b1326..165d273432 100644 --- a/tests/tbs/tb0267.pp +++ b/tests/tbs/tb0267.pp @@ -69,7 +69,7 @@ begin aw:=-4; bw:=45; asm - fildw aw + filds aw fstpl a end; if a<>-4.0 then