Browse Source

Downgrade some warnings to notes for EXTDEBUG

git-svn-id: trunk@39924 -
pierre 6 years ago
parent
commit
5ccced201a
2 changed files with 12 additions and 2 deletions
  1. 8 1
      compiler/pass_2.pas
  2. 4 1
      compiler/tgobj.pas

+ 8 - 1
compiler/pass_2.pas

@@ -210,7 +210,14 @@ implementation
             if (not codegenerror) then
             if (not codegenerror) then
              begin
              begin
                if (p.location.loc<>p.expectloc) then
                if (p.location.loc<>p.expectloc) then
-                 Comment(V_Warning,'Location ('+tcgloc2str[p.location.loc]+') not equal to expectloc ('+tcgloc2str[p.expectloc]+'): '+nodetype2str[p.nodetype]);
+                 begin
+                   if ((p.location.loc=loc_register) and (p.expectloc=loc_cregister))
+                      or ((p.location.loc=loc_fpuregister) and (p.expectloc=loc_cfpuregister))
+                      or ((p.location.loc=loc_reference) and (p.expectloc=loc_creference)) then
+                     Comment(V_Note,'Location ('+tcgloc2str[p.location.loc]+') not equal to expectloc ('+tcgloc2str[p.expectloc]+'): '+nodetype2str[p.nodetype])
+                   else
+                     Comment(V_Warning,'Location ('+tcgloc2str[p.location.loc]+') not equal to expectloc ('+tcgloc2str[p.expectloc]+'): '+nodetype2str[p.nodetype]);
+                 end;
                if (p.location.loc=LOC_INVALID) then
                if (p.location.loc=LOC_INVALID) then
                  Comment(V_Warning,'Location not set in secondpass: '+nodetype2str[p.nodetype]);
                  Comment(V_Warning,'Location not set in secondpass: '+nodetype2str[p.nodetype]);
              end;
              end;

+ 4 - 1
compiler/tgobj.pas

@@ -494,7 +494,10 @@ implementation
                if not(hp^.temptype in temptypes) then
                if not(hp^.temptype in temptypes) then
                 begin
                 begin
 {$ifdef EXTDEBUG}
 {$ifdef EXTDEBUG}
-                  Comment(V_Warning,'tgobj: (Freetemp) temp at pos '+tostr(pos.val)+ ' has different type ('+TempTypeStr[hp^.temptype]+'), not releasing');
+                  if hp^.temptype = tt_persistent then
+                    Comment(V_Note,'tgobj: (Freetemp) temp at pos '+tostr(pos.val)+ ' has different type ('+TempTypeStr[hp^.temptype]+'), not releasing')
+                  else
+                    Comment(V_Warning,'tgobj: (Freetemp) temp at pos '+tostr(pos.val)+ ' has different type ('+TempTypeStr[hp^.temptype]+'), not releasing');
                   list.concat(tai_tempalloc.allocinfo(hp^.pos,hp^.size,'temp has wrong type ('+TempTypeStr[hp^.temptype]+') not releasing'));
                   list.concat(tai_tempalloc.allocinfo(hp^.pos,hp^.size,'temp has wrong type ('+TempTypeStr[hp^.temptype]+') not releasing'));
 {$endif}
 {$endif}
                   exit;
                   exit;