Browse Source

* do not omit location_force_reg on second operand of sar/ro* if
it is used to adapt the size of the operand

git-svn-id: trunk@48855 -

florian 4 years ago
parent
commit
316f2429f0
1 changed files with 2 additions and 1 deletions
  1. 2 1
      compiler/ncginl.pas

+ 2 - 1
compiler/ncginl.pas

@@ -932,7 +932,8 @@ implementation
                  else
                  else
 {$endif not cpu64bitalu and not cpuhighleveltarget}
 {$endif not cpu64bitalu and not cpuhighleveltarget}
                    begin
                    begin
-                     if not(op2.location.loc in [LOC_REGISTER,LOC_CREGISTER]) then
+                     if not(op2.location.loc in [LOC_REGISTER,LOC_CREGISTER]) or
+                       not(equal_defs(op2.resultdef,resultdef)) then
                        hlcg.location_force_reg(current_asmdata.CurrAsmList,op2.location,
                        hlcg.location_force_reg(current_asmdata.CurrAsmList,op2.location,
                                                op2.resultdef,resultdef,true);
                                                op2.resultdef,resultdef,true);
                      hlcg.a_op_reg_reg_reg(current_asmdata.CurrAsmList,op,resultdef,
                      hlcg.a_op_reg_reg_reg(current_asmdata.CurrAsmList,op,resultdef,