Browse Source

* only transform multiplication nodes to sqr, not any kind of addnode
(fix for 18252)

git-svn-id: trunk@18263 -

Jonas Maebe 14 years ago
parent
commit
8c7f1e1013
1 changed files with 3 additions and 2 deletions
  1. 3 2
      compiler/nadd.pas

+ 3 - 2
compiler/nadd.pas

@@ -782,8 +782,9 @@ implementation
 
             { using sqr(x) for reals instead of x*x might reduces register pressure and/or
               memory accesses while sqr(<real>) has no drawback }
-            if is_real(left.resultdef) and is_real(right.resultdef) and
-              left.isequal(right) then
+            if (nodetype=muln) and
+               is_real(left.resultdef) and is_real(right.resultdef) and
+               left.isequal(right) then
               begin
                 result:=cinlinenode.create(in_sqr_real,false,left);
                 left:=nil;