소스 검색

* also don't put a value in registers if it is converted from a type that can
be held in one kind of register to a type that can be held in another kind
of register (mantis #25361)

git-svn-id: trunk@26128 -

Jonas Maebe 11 년 전
부모
커밋
7be4e20307
3개의 변경된 파일20개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 0
      .gitattributes
  2. 2 2
      compiler/ncnv.pas
  3. 17 0
      tests/webtbs/tw25361.pp

+ 1 - 0
.gitattributes

@@ -13716,6 +13716,7 @@ tests/webtbs/tw25289.pp svneol=native#text/plain
 tests/webtbs/tw25318.pp svneol=native#text/pascal
 tests/webtbs/tw25318.pp svneol=native#text/pascal
 tests/webtbs/tw25349.pp svneol=native#text/plain
 tests/webtbs/tw25349.pp svneol=native#text/plain
 tests/webtbs/tw2536.pp svneol=native#text/plain
 tests/webtbs/tw2536.pp svneol=native#text/plain
+tests/webtbs/tw25361.pp svneol=native#text/plain
 tests/webtbs/tw2540.pp svneol=native#text/plain
 tests/webtbs/tw2540.pp svneol=native#text/plain
 tests/webtbs/tw2561.pp svneol=native#text/plain
 tests/webtbs/tw2561.pp svneol=native#text/plain
 tests/webtbs/tw2588.pp svneol=native#text/plain
 tests/webtbs/tw2588.pp svneol=native#text/plain

+ 2 - 2
compiler/ncnv.pas

@@ -2103,8 +2103,8 @@ implementation
         if (nf_absolute in flags) then
         if (nf_absolute in flags) then
           begin
           begin
             convtype:=tc_equal;
             convtype:=tc_equal;
-            if not(tstoreddef(resultdef).is_intregable) and
-               not(tstoreddef(resultdef).is_fpuregable) then
+            if (tstoreddef(resultdef).is_intregable<>tstoreddef(left.resultdef).is_intregable) or
+            (tstoreddef(resultdef).is_fpuregable<>tstoreddef(left.resultdef).is_fpuregable) then
               make_not_regable(left,[ra_addr_regable]);
               make_not_regable(left,[ra_addr_regable]);
             exit;
             exit;
           end;
           end;

+ 17 - 0
tests/webtbs/tw25361.pp

@@ -0,0 +1,17 @@
+{ %norun }
+
+type
+  float64=record
+    high,low: longint;
+  end; 
+
+procedure foo(x: double);
+var
+  a: float64 absolute x;
+begin
+  writeln(a.low);
+end;
+
+begin
+end.
+