浏览代码

* don't keep tc_equal type conversions for LLVM in case the resultdef doesn't
change, since then we definitely don't have to insert a type conversion at
the LLVM level either (fixes webtbs/tw1901 for LLVM)

git-svn-id: trunk@35057 -

Jonas Maebe 8 年之前
父节点
当前提交
a2017b2327
共有 1 个文件被更改,包括 11 次插入10 次删除
  1. 11 10
      compiler/ncnv.pas

+ 11 - 10
compiler/ncnv.pas

@@ -2209,19 +2209,20 @@ implementation
                        to different kinds of refcounting helpers }
                        to different kinds of refcounting helpers }
                       (resultdef=left.resultdef)) then
                       (resultdef=left.resultdef)) then
                    begin
                    begin
-{$ifndef llvm}
-                     left.resultdef:=resultdef;
-                     if (nf_explicit in flags) and (left.nodetype = addrn) then
-                       include(left.flags, nf_typedaddr);
-                     result:=left;
-                     left:=nil;
-{$else llvm}
+{$ifdef llvm}
                      { we still may have to insert a type conversion at the
                      { we still may have to insert a type conversion at the
                        llvm level }
                        llvm level }
-                     if (nf_explicit in flags) and (left.nodetype = addrn) then
-                       include(flags, nf_typedaddr);
-                     result:=nil;
+                     if left.resultdef<>resultdef then
+                       result:=nil
+                     else
 {$endif llvm}
 {$endif llvm}
+                       begin
+                         left.resultdef:=resultdef;
+                         if (nf_explicit in flags) and (left.nodetype = addrn) then
+                           include(left.flags, nf_typedaddr);
+                         result:=left;
+                         left:=nil;
+                       end;
                      exit;
                      exit;
                    end;
                    end;
                 end;
                 end;