فهرست منبع

+ check for location.loc<>expectloc in extdebug mode
* set expectloc properly for add nodes on arm

git-svn-id: trunk@10536 -

florian 17 سال پیش
والد
کامیت
7ef191021f
2فایلهای تغییر یافته به همراه15 افزوده شده و 8 حذف شده
  1. 13 8
      compiler/arm/narmadd.pas
  2. 2 0
      compiler/pass_2.pas

+ 13 - 8
compiler/arm/narmadd.pas

@@ -301,17 +301,22 @@ interface
 
 
     function tarmaddnode.pass_1 : tnode;
+      var
+        unsigned : boolean;
       begin
         result:=inherited pass_1;
 
-        { handling boolean expressions }
-        if not(assigned(result)) and
-           (
-             not(is_boolean(left.resultdef)) or
-             not(is_boolean(right.resultdef)) or
-             is_dynamic_array(left.resultdef)
-           ) then
-          expectloc:=LOC_FLAGS;
+        if not(assigned(result)) then
+          begin
+            unsigned:=not(is_signed(left.resultdef)) or
+              not(is_signed(right.resultdef));
+
+            if is_64bit(left.resultdef) and
+              ((nodetype in [equaln,unequaln]) or
+               (unsigned and (nodetype in [ltn,lten,gtn,gten]))
+              ) then
+              expectloc:=LOC_FLAGS;
+          end;
       end;
 
 

+ 2 - 0
compiler/pass_2.pas

@@ -186,6 +186,8 @@ implementation
               logsecond(p.nodetype,false);
             if (not codegenerror) then
              begin
+               if (p.location.loc<>p.expectloc) then
+                 Comment(V_Warning,'Location not equal to expectloc: '+nodetype2str[p.nodetype]);
                if (p.location.loc=LOC_INVALID) then
                  Comment(V_Warning,'Location not set in secondpass: '+nodetype2str[p.nodetype]);
              end;