mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 13:59:28 +02:00
* only do the '0*x' and '0 and x' optimization if x has no side effects (except
at -O4, where it is done regardless of whether there are side effects or not) git-svn-id: trunk@36039 -
This commit is contained in:
parent
142d95e0d2
commit
f26a844b19
@ -589,7 +589,9 @@ implementation
|
||||
addn,subn,orn,xorn:
|
||||
result := left.getcopy;
|
||||
andn,muln:
|
||||
result:=cordconstnode.create(0,resultdef,true);
|
||||
if (cs_opt_level4 in current_settings.optimizerswitches) or
|
||||
not might_have_sideeffects(left) then
|
||||
result:=cordconstnode.create(0,resultdef,true);
|
||||
end;
|
||||
end
|
||||
else if tordconstnode(right).value = 1 then
|
||||
@ -619,7 +621,9 @@ implementation
|
||||
subn:
|
||||
result := cunaryminusnode.create(right.getcopy);
|
||||
andn,muln:
|
||||
result:=cordconstnode.create(0,right.resultdef,true);
|
||||
if (cs_opt_level4 in current_settings.optimizerswitches) or
|
||||
not might_have_sideeffects(right) then
|
||||
result:=cordconstnode.create(0,right.resultdef,true);
|
||||
end;
|
||||
end
|
||||
else if tordconstnode(left).value = 1 then
|
||||
|
Loading…
Reference in New Issue
Block a user