Sfoglia il codice sorgente

* better setting of expectloc

git-svn-id: trunk@44619 -
florian 5 anni fa
parent
commit
04f3784af5
2 ha cambiato i file con 8 aggiunte e 4 eliminazioni
  1. 4 0
      compiler/ncnv.pas
  2. 4 4
      compiler/nmat.pas

+ 4 - 0
compiler/ncnv.pas

@@ -3529,7 +3529,11 @@ implementation
             (left.resultdef.size=resultdef.size) and
             (left.expectloc in [LOC_REFERENCE,LOC_CREFERENCE,LOC_CREGISTER]) then
            begin
+{$ifdef xtensa}
+             expectloc:=LOC_REGISTER;
+{$else xtensa}
              expectloc:=left.expectloc;
+{$endif xtensa}
              exit;
            end;
          { when converting 64bit int to C-ctyle boolean, first convert to an int32 and then }

+ 4 - 4
compiler/nmat.pas

@@ -1317,12 +1317,12 @@ implementation
            begin
              if (expectloc in [LOC_REFERENCE,LOC_CREFERENCE,LOC_CREGISTER]) then
                expectloc:=LOC_REGISTER;
-            { before loading it into flags we need to load it into
-              a register thus 1 register is need PM }
-{$ifdef cpuflags}
+             { xtensa has boolean registers which are treateed as flags but they
+               are not used for boolean expressions }
+{$if defined(cpuflags) and not(defined(xtensa))}
              if left.expectloc<>LOC_JUMP then
                expectloc:=LOC_FLAGS;
-{$endif def cpuflags}
+{$endif defined(cpuflags) and not(defined(xtensa)}
            end
          else
 {$ifdef SUPPORT_MMX}