|
@@ -1100,6 +1100,12 @@ implementation
|
|
|
begin
|
|
|
result:=right.getcopy;
|
|
|
exit;
|
|
|
+ end
|
|
|
+ else if (trealconstnode(left).value_real=2) and (nodetype=muln) and not(might_have_sideeffects(right,[mhs_exceptions])) and
|
|
|
+ (node_complexity(right)<=1) then
|
|
|
+ begin
|
|
|
+ result:=caddnode.create_internal(addn,right.getcopy,right.getcopy);
|
|
|
+ exit;
|
|
|
end;
|
|
|
end
|
|
|
else if rt=realconstn then
|
|
@@ -1127,6 +1133,12 @@ implementation
|
|
|
begin
|
|
|
result:=left.getcopy;
|
|
|
exit;
|
|
|
+ end
|
|
|
+ else if (trealconstnode(right).value_real=2) and (nodetype=muln) and not(might_have_sideeffects(left,[mhs_exceptions])) and
|
|
|
+ (node_complexity(left)<=1) then
|
|
|
+ begin
|
|
|
+ result:=caddnode.create_internal(addn,left.getcopy,left.getcopy);
|
|
|
+ exit;
|
|
|
end;
|
|
|
end
|
|
|
{ optimize a/a and a-a }
|