Browse Source

* internalerror with mod/div fixed

florian 27 years ago
parent
commit
c1c5ec3235
4 changed files with 19 additions and 7 deletions
  1. 6 3
      compiler/cg386mat.pas
  2. 1 1
      compiler/mppc386.bat
  3. 7 1
      compiler/pass_1.pas
  4. 5 2
      compiler/pexpr.pas

+ 6 - 3
compiler/cg386mat.pas

@@ -123,7 +123,7 @@ implementation
                 begin
                 begin
                    if not(R_EDX in unused) then
                    if not(R_EDX in unused) then
                      begin
                      begin
-                              exprasmlist^.concat(new(pai386,op_reg(A_PUSH,S_L,R_EDX)));
+                        exprasmlist^.concat(new(pai386,op_reg(A_PUSH,S_L,R_EDX)));
                         popedx:=true;
                         popedx:=true;
                      end;
                      end;
                    if hreg1<>R_EAX then
                    if hreg1<>R_EAX then
@@ -148,7 +148,7 @@ implementation
                         emit_reg_reg(A_MOV,S_L,R_EAX,hreg1)
                         emit_reg_reg(A_MOV,S_L,R_EAX,hreg1)
                      end
                      end
                    else
                    else
-                          if hreg1<>R_EAX then
+                     if hreg1<>R_EAX then
                        emit_reg_reg(A_MOV,S_L,R_EAX,hreg1);
                        emit_reg_reg(A_MOV,S_L,R_EAX,hreg1);
                 end
                 end
               else
               else
@@ -549,7 +549,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.4  1998-08-18 09:24:38  pierre
+  Revision 1.5  1998-08-23 16:07:20  florian
+    * internalerror with mod/div fixed
+
+  Revision 1.4  1998/08/18 09:24:38  pierre
     * small warning position bug fixed
     * small warning position bug fixed
     * support_mmx switches splitting was missing
     * support_mmx switches splitting was missing
     * rhide error and warning output corrected
     * rhide error and warning output corrected

+ 1 - 1
compiler/mppc386.bat

@@ -1,4 +1,4 @@
-ppc386 -Ch8000000 -dI386 -dGDB -a -Sg -OG5az pp.pas %1 %2 %3 %4 %5 %6 %7 %8 %9
+ppc386 -Ch8000000 -dI386 -dGDB -O2p5 -a -Sg pp.pas %1 %2 %3 %4 %5 %6 %7 %8 %9
 if errorlevel 0 goto success
 if errorlevel 0 goto success
 goto failed
 goto failed
 :success
 :success

+ 7 - 1
compiler/pass_1.pas

@@ -1506,6 +1506,9 @@ unit pass_1;
            exit;
            exit;
 
 
          left_right_max(p);
          left_right_max(p);
+         if p^.left^.registers32<=p^.right^.registers32 then
+           inc(p^.registers32);
+
          p^.resulttype:=s32bitdef;
          p^.resulttype:=s32bitdef;
          p^.location.loc:=LOC_REGISTER;
          p^.location.loc:=LOC_REGISTER;
       end;
       end;
@@ -5234,7 +5237,10 @@ unit pass_1;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.61  1998-08-21 14:08:47  pierre
+  Revision 1.62  1998-08-23 16:07:22  florian
+    * internalerror with mod/div fixed
+
+  Revision 1.61  1998/08/21 14:08:47  pierre
     + TEST_FUNCRET now default (old code removed)
     + TEST_FUNCRET now default (old code removed)
       works also for m68k (at least compiles)
       works also for m68k (at least compiles)
 
 

+ 5 - 2
compiler/pexpr.pas

@@ -685,7 +685,7 @@ unit pexpr;
             begin
             begin
                { is this an access to a function result ? }
                { is this an access to a function result ? }
                if assigned(p^.funcretsym) and
                if assigned(p^.funcretsym) and
-                  ((sym=p^.funcretsym) or
+                  ((pfuncretsym(sym)=p^.funcretsym) or
                   ((pvarsym(sym)=opsym) and
                   ((pvarsym(sym)=opsym) and
                   ((p^.flags and pi_operator)<>0))) and
                   ((p^.flags and pi_operator)<>0))) and
                   (p^.retdef<>pdef(voiddef)) and
                   (p^.retdef<>pdef(voiddef)) and
@@ -1856,7 +1856,10 @@ unit pexpr;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.42  1998-08-21 14:08:50  pierre
+  Revision 1.43  1998-08-23 16:07:24  florian
+    * internalerror with mod/div fixed
+
+  Revision 1.42  1998/08/21 14:08:50  pierre
     + TEST_FUNCRET now default (old code removed)
     + TEST_FUNCRET now default (old code removed)
       works also for m68k (at least compiles)
       works also for m68k (at least compiles)