* only transform multiplication nodes to sqr, not any kind of addnode

(fix for 18252)

git-svn-id: trunk@18263 -
This commit is contained in:
Jonas Maebe 2011-08-18 12:47:41 +00:00
parent 3abfec476a
commit 8c7f1e1013

View File

@ -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;