浏览代码

* don't load data in a register when converting from void to an integer
type (like with integer(pointer1^):=integer(pointer2^))

git-svn-id: trunk@32743 -

Jonas Maebe 9 年之前
父节点
当前提交
e3d2980c98
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      compiler/llvm/nllvmcnv.pas

+ 2 - 1
compiler/llvm/nllvmcnv.pas

@@ -108,7 +108,8 @@ procedure tllvmtypeconvnode.second_int_to_int;
     tosize:=resultdef.size;
     tosize:=resultdef.size;
     location_copy(location,left.location);
     location_copy(location,left.location);
     if not(left.location.loc in [LOC_REFERENCE,LOC_CREFERENCE]) or
     if not(left.location.loc in [LOC_REFERENCE,LOC_CREFERENCE]) or
-       (fromsize<>tosize) then
+       ((fromsize<>tosize) and
+        not is_void(left.resultdef)) then
       begin
       begin
         hlcg.location_force_reg(current_asmdata.CurrAsmList,location,left.resultdef,resultdef,left.location.loc=LOC_CREGISTER);
         hlcg.location_force_reg(current_asmdata.CurrAsmList,location,left.resultdef,resultdef,left.location.loc=LOC_CREGISTER);
       end
       end