mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 16:19:21 +02:00
* do +/-/pred/succ to inc/dec optimizations only at an appropriate optimziation level
git-svn-id: trunk@35569 -
This commit is contained in:
parent
a7c7319352
commit
b55cb246da
@ -566,6 +566,8 @@ implementation
|
||||
not equal_defs(right.resultdef,left.resultdef) then
|
||||
inserttypeconv(right,left.resultdef);
|
||||
|
||||
if cs_opt_level2 in current_settings.optimizerswitches then
|
||||
begin
|
||||
{ replace i:=succ/pred(i) by inc/dec(i)? }
|
||||
if (right.nodetype=inlinen) and
|
||||
((tinlinenode(right).inlinenumber=in_succ_x) or (tinlinenode(right).inlinenumber=in_pred_x)) and
|
||||
@ -585,6 +587,8 @@ implementation
|
||||
left:=nil;
|
||||
exit;
|
||||
end;
|
||||
if cs_opt_level3 in current_settings.optimizerswitches then
|
||||
begin
|
||||
{ replace i:=i+k/i:=i-k by inc/dec(i,k)? }
|
||||
if (right.nodetype in [addn,subn]) and
|
||||
(taddnode(right).left.isequal(left)) and
|
||||
@ -624,6 +628,8 @@ implementation
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
function tassignmentnode.pass_typecheck:tnode;
|
||||
|
Loading…
Reference in New Issue
Block a user