Bläddra i källkod

* m68k: do not emit moves between same register, they end up in wrong code in some cases when register needs to be spilled (and entirely useless otherwise).

git-svn-id: trunk@28545 -
sergei 11 år sedan
förälder
incheckning
a5958d6e5f
1 ändrade filer med 7 tillägg och 4 borttagningar
  1. 7 4
      compiler/m68k/cgcpu.pas

+ 7 - 4
compiler/m68k/cgcpu.pas

@@ -914,10 +914,13 @@ unit cgcpu;
       var
         instr : taicpu;
       begin
-         { move to destination register }
-         instr:=taicpu.op_reg_reg(A_MOVE,TCGSize2OpSize[fromsize],reg1,reg2);
-         add_move_instruction(instr);
-         list.concat(instr);
+        { move to destination register }
+        if (reg1<>reg2) then
+          begin
+            instr:=taicpu.op_reg_reg(A_MOVE,TCGSize2OpSize[fromsize],reg1,reg2);
+            add_move_instruction(instr);
+            list.concat(instr);
+          end;
          sign_extend(list, fromsize, reg2);
       end;