ソースを参照

* workaround missing optimizer capabilites of the fixes branch to fix avr compilation with -CriotR

florian 3 年 前
コミット
a76d096254
1 ファイル変更5 行追加1 行削除
  1. 5 1
      compiler/rgobj.pas

+ 5 - 1
compiler/rgobj.pas

@@ -1536,11 +1536,15 @@ unit rgobj;
           {        while compiling the compiler. }
           {        while compiling the compiler. }
           tmpr:=NR_STACK_POINTER_REG;
           tmpr:=NR_STACK_POINTER_REG;
           { e.g. AVR does not have a stack pointer register }
           { e.g. AVR does not have a stack pointer register }
+{$ifndef AVR}  { 3.2.x does not optimize away the if statement based on the
+                 first condition so the include(...) statement causes an compilation
+                 error }
 {$push}{$warnings off}
 {$push}{$warnings off}
           if (RS_STACK_POINTER_REG<>RS_INVALID) and
           if (RS_STACK_POINTER_REG<>RS_INVALID) and
 {$pop}
 {$pop}
             (regtype=getregtype(tmpr)) then
             (regtype=getregtype(tmpr)) then
             include(adj_colours,RS_STACK_POINTER_REG);
             include(adj_colours,RS_STACK_POINTER_REG);
+{$endif AVR}
           {Assume a spill by default...}
           {Assume a spill by default...}
           found:=false;
           found:=false;
           {Search for a colour not in this list.}
           {Search for a colour not in this list.}
@@ -2162,7 +2166,7 @@ unit rgobj;
                   begin
                   begin
                     if (getregtype(reg)=regtype) then
                     if (getregtype(reg)=regtype) then
                       begin
                       begin
-                        {A register allocation of the spilled register (and all coalesced registers) 
+                        {A register allocation of the spilled register (and all coalesced registers)
                          must be removed.}
                          must be removed.}
                         supreg:=get_alias(getsupreg(reg));
                         supreg:=get_alias(getsupreg(reg));
                         if supregset_in(regs_to_spill_set,supreg) then
                         if supregset_in(regs_to_spill_set,supreg) then