浏览代码

* handle LOC_JUMP correctly for 64 bit boolean assignments

git-svn-id: trunk@19967 -
florian 13 年之前
父节点
当前提交
fd07f51f35
共有 1 个文件被更改,包括 23 次插入3 次删除
  1. 23 3
      compiler/ncgld.pas

+ 23 - 3
compiler/ncgld.pas

@@ -929,12 +929,32 @@ implementation
                   current_asmdata.getjumplabel(hlabel);
                   cg.a_label(current_asmdata.CurrAsmList,current_procinfo.CurrTrueLabel);
                   if is_pasbool(left.resultdef) then
-                    cg.a_load_const_loc(current_asmdata.CurrAsmList,1,left.location)
+                    begin
+{$ifndef cpu64bitalu}
+                      if left.location.size in [OS_64,OS_S64] then
+                        cg64.a_load64_const_loc(current_asmdata.CurrAsmList,1,left.location)
+                      else
+{$endif not cpu64bitalu}
+                        cg.a_load_const_loc(current_asmdata.CurrAsmList,1,left.location)
+                    end
                   else
-                    cg.a_load_const_loc(current_asmdata.CurrAsmList,-1,left.location);
+                    begin
+{$ifndef cpu64bitalu}
+                      if left.location.size in [OS_64,OS_S64] then
+                        cg64.a_load64_const_loc(current_asmdata.CurrAsmList,-1,left.location)
+                      else
+{$endif not cpu64bitalu}
+                        cg.a_load_const_loc(current_asmdata.CurrAsmList,-1,left.location);
+                    end;
+
                   cg.a_jmp_always(current_asmdata.CurrAsmList,hlabel);
                   cg.a_label(current_asmdata.CurrAsmList,current_procinfo.CurrFalseLabel);
-                  cg.a_load_const_loc(current_asmdata.CurrAsmList,0,left.location);
+{$ifndef cpu64bitalu}
+                  if left.location.size in [OS_64,OS_S64] then
+                    cg64.a_load64_const_loc(current_asmdata.CurrAsmList,0,left.location)
+                  else
+{$endif not cpu64bitalu}
+                    cg.a_load_const_loc(current_asmdata.CurrAsmList,0,left.location);
                   cg.a_label(current_asmdata.CurrAsmList,hlabel);
                 end;
 {$ifdef cpuflags}