Browse Source

* several bugs regarding -Or fixed

florian 26 years ago
parent
commit
8836c26503
5 changed files with 37 additions and 12 deletions
  1. 6 3
      compiler/i386asm.pas
  2. 1 1
      compiler/mppc386.bat
  3. 15 6
      compiler/pass_2.pas
  4. 7 1
      compiler/popt386.pas
  5. 8 1
      compiler/tcinl.pas

+ 6 - 3
compiler/i386asm.pas

@@ -768,7 +768,7 @@ begin
   InsOffset:=Offset;
   InsOffset:=Offset;
 { Things which may only be done once, not when a second pass is done to
 { Things which may only be done once, not when a second pass is done to
   optimize }
   optimize }
-  if not assigned(Insentry) then
+  if Insentry=nil then
    begin
    begin
      { Check if error last time then InsSize=-1 }
      { Check if error last time then InsSize=-1 }
      if InsSize=-1 then
      if InsSize=-1 then
@@ -852,7 +852,7 @@ var
   c : longint;
   c : longint;
 begin
 begin
   { error in pass1 ? }
   { error in pass1 ? }
-  if not assigned(insentry) then
+  if insentry=nil then
    exit;
    exit;
   aktfilepos:=fileinfo;
   aktfilepos:=fileinfo;
   { Segment override }
   { Segment override }
@@ -1569,7 +1569,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.1  1999-05-01 13:24:23  peter
+  Revision 1.2  1999-05-02 21:33:52  florian
+    * several bugs regarding -Or fixed
+
+  Revision 1.1  1999/05/01 13:24:23  peter
     * merged nasm compiler
     * merged nasm compiler
     * old asm moved to oldasm/
     * old asm moved to oldasm/
 
 

+ 1 - 1
compiler/mppc386.bat

@@ -1,4 +1,4 @@
-ppc386 -OG2p2 -Ch8000000 -dI386 -dGDB -a -Sg pp.pas %1 %2 %3 %4 %5 %6 %7 %8 %9
+ppc386 -OG2p2 -Ch8000000 -dI386 -dGDB -dBROWSERLOG -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

+ 15 - 6
compiler/pass_2.pas

@@ -518,15 +518,21 @@ implementation
                                { dummy }
                                { dummy }
                                regsize:=S_W;
                                regsize:=S_W;
                           end;
                           end;
-                        if (status.verbosity and v_debug)=v_debug then
+                        for i:=1 to maxvarregs do
                           begin
                           begin
-                             for i:=1 to maxvarregs do
+                             if assigned(regvars[i]) then
                                begin
                                begin
-                                  if assigned(regvars[i]) then
-                                   Message3(cg_d_register_weight,reg2str(regvars[i]^.reg),
-                                           tostr(regvars[i]^.refs),regvars[i]^.name);
+                                  if cs_asm_source in aktglobalswitches then
+                                    procinfo.aktentrycode^.insert(new(pai_asm_comment,init(strpnew(regvars[i]^.name+
+                                      ' with weight '+tostr(regvars[i]^.refs)+' assigned to register '+
+                                      reg2str(regvars[i]^.reg)))));
+                                  if (status.verbosity and v_debug)=v_debug then
+                                    Message3(cg_d_register_weight,reg2str(regvars[i]^.reg),
+                                      tostr(regvars[i]^.refs),regvars[i]^.name);
                                end;
                                end;
                           end;
                           end;
+                        if cs_asm_source in aktglobalswitches then
+                          procinfo.aktentrycode^.insert(new(pai_asm_comment,init(strpnew('Register variable assignment:'))));
                      end;
                      end;
                 end;
                 end;
               if assigned(aktprocsym) and
               if assigned(aktprocsym) and
@@ -547,7 +553,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.19  1999-05-01 13:24:28  peter
+  Revision 1.20  1999-05-02 21:33:54  florian
+    * several bugs regarding -Or fixed
+
+  Revision 1.19  1999/05/01 13:24:28  peter
     * merged nasm compiler
     * merged nasm compiler
     * old asm moved to oldasm/
     * old asm moved to oldasm/
 
 

+ 7 - 1
compiler/popt386.pas

@@ -1033,6 +1033,9 @@ Begin
                        End
                        End
                      Else
                      Else
                        Begin
                        Begin
+                         { change it to a two op operation }
+                         Pai386(p)^.oper[1].typ:=top_none;
+                         Pai386(p)^.ops:=2;
                          Pai386(p)^.opcode := A_MOV;
                          Pai386(p)^.opcode := A_MOV;
                          Pai386(p)^.Loadoper(1,Pai386(p)^.oper[0]);
                          Pai386(p)^.Loadoper(1,Pai386(p)^.oper[0]);
                          New(TmpRef);
                          New(TmpRef);
@@ -1508,7 +1511,10 @@ End.
 
 
 {
 {
  $Log$
  $Log$
- Revision 1.49  1999-05-02 14:26:31  peter
+ Revision 1.50  1999-05-02 21:33:55  florian
+   * several bugs regarding -Or fixed
+
+ Revision 1.49  1999/05/02 14:26:31  peter
    * fixed dec -> sub $1 opt which didn't set ops=2
    * fixed dec -> sub $1 opt which didn't set ops=2
 
 
  Revision 1.48  1999/05/01 13:24:34  peter
  Revision 1.48  1999/05/01 13:24:34  peter

+ 8 - 1
compiler/tcinl.pas

@@ -933,6 +933,10 @@ implementation
                    end;
                    end;
                   { calc registers }
                   { calc registers }
                   left_right_max(p);
                   left_right_max(p);
+
+                  { val doesn't calculate the registers really }
+                  { correct, we need one register extra   (FK) }
+                  inc(p^.registers32,2);
                end;
                end;
 {$EndIf OLDVAL}
 {$EndIf OLDVAL}
 
 
@@ -1100,7 +1104,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.30  1999-05-01 13:24:53  peter
+  Revision 1.31  1999-05-02 21:33:57  florian
+    * several bugs regarding -Or fixed
+
+  Revision 1.30  1999/05/01 13:24:53  peter
     * merged nasm compiler
     * merged nasm compiler
     * old asm moved to oldasm/
     * old asm moved to oldasm/