Browse Source

* fixed 1/s problem from mailing list

florian 26 năm trước cách đây
mục cha
commit
00b063c621

+ 5 - 2
compiler/ag386att.pas

@@ -710,7 +710,7 @@ unit ag386att;
                     end
                     end
                   else
                   else
                    begin
                    begin
-                     for i:=0to paicpu(hp)^.ops-1 do
+                     for i:=0 to paicpu(hp)^.ops-1 do
                       begin
                       begin
                         if i=0 then
                         if i=0 then
                          sep:=#9
                          sep:=#9
@@ -865,7 +865,10 @@ unit ag386att;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.15  1999-09-19 20:55:11  florian
+  Revision 1.16  1999-09-21 20:53:21  florian
+    * fixed 1/s problem from mailing list
+
+  Revision 1.15  1999/09/19 20:55:11  florian
     * fixed calls to procedures with manglednames=255 chars
     * fixed calls to procedures with manglednames=255 chars
       (taking the address of such a procedure would still cause a problem!)
       (taking the address of such a procedure would still cause a problem!)
 
 

+ 8 - 3
compiler/cg386add.pas

@@ -1802,8 +1802,10 @@ implementation
                if (p^.left^.resulttype^.deftype=floatdef) and
                if (p^.left^.resulttype^.deftype=floatdef) and
                   (pfloatdef(p^.left^.resulttype)^.typ<>f32bit) then
                   (pfloatdef(p^.left^.resulttype)^.typ<>f32bit) then
                  begin
                  begin
-                    { real constants to the left }
-                    if p^.left^.treetype=realconstn then
+                    { real constants to the right, but only if it
+                      isn't on the FPU stack, i.e. 1.0 or 0.0! }
+                    if (p^.left^.treetype=realconstn) and
+                      (p^.left^.location.loc<>LOC_FPU) then
                       swaptree(p);
                       swaptree(p);
                     cmpop:=false;
                     cmpop:=false;
                     case p^.treetype of
                     case p^.treetype of
@@ -2140,7 +2142,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.78  1999-09-07 07:52:19  peter
+  Revision 1.79  1999-09-21 20:53:21  florian
+    * fixed 1/s problem from mailing list
+
+  Revision 1.78  1999/09/07 07:52:19  peter
     * > < >= <= support for boolean
     * > < >= <= support for boolean
     * boolean constants are now calculated like integer constants
     * boolean constants are now calculated like integer constants
 
 

+ 10 - 3
compiler/tokens.pas

@@ -438,8 +438,12 @@ var
 {$endif TP}
 {$endif TP}
 begin
 begin
 {$ifdef TP}
 {$ifdef TP}
-    fsplit(paramstr(0),n,d,e);
-    assign(f,d+'\tokens.dat');
+    fsplit(paramstr(0),d,n,e);
+    { when debugging d=''!!!! FK }
+    if d='' then
+      assign(f,'tokens.dat')
+    else
+      assign(f,d+'\tokens.dat');
     {$I-}
     {$I-}
     reset(f,1);
     reset(f,1);
     {We are not sure that the msg file is loaded!}
     {We are not sure that the msg file is loaded!}
@@ -492,7 +496,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.16  1999-09-17 09:17:49  peter
+  Revision 1.17  1999-09-21 20:53:23  florian
+    * fixed 1/s problem from mailing list
+
+  Revision 1.16  1999/09/17 09:17:49  peter
     * removed uses globals
     * removed uses globals
 
 
   Revision 1.15  1999/09/16 13:41:37  peter
   Revision 1.15  1999/09/16 13:41:37  peter