mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-11 04:19:32 +01:00
* Don't widen boolean operands of taddnode if they will be converted to pasbool8 immediately thereafter, doing so only causes generation of useless code. Mantis #20843.
git-svn-id: trunk@20376 -
This commit is contained in:
parent
f8f5c3cd23
commit
eda5511ef9
@ -1206,9 +1206,15 @@ implementation
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ 2 booleans? Make them equal to the largest boolean }
|
{ 2 booleans? }
|
||||||
if (is_boolean(ld) and is_boolean(rd)) then
|
if (is_boolean(ld) and is_boolean(rd)) then
|
||||||
begin
|
begin
|
||||||
|
case nodetype of
|
||||||
|
xorn,
|
||||||
|
andn,
|
||||||
|
orn:
|
||||||
|
begin
|
||||||
|
{ Make sides equal to the largest boolean }
|
||||||
if (torddef(left.resultdef).size>torddef(right.resultdef).size) or
|
if (torddef(left.resultdef).size>torddef(right.resultdef).size) or
|
||||||
(is_cbool(left.resultdef) and not is_cbool(right.resultdef)) then
|
(is_cbool(left.resultdef) and not is_cbool(right.resultdef)) then
|
||||||
begin
|
begin
|
||||||
@ -1223,11 +1229,6 @@ implementation
|
|||||||
ttypeconvnode(left).convtype:=tc_bool_2_bool;
|
ttypeconvnode(left).convtype:=tc_bool_2_bool;
|
||||||
typecheckpass(left);
|
typecheckpass(left);
|
||||||
end;
|
end;
|
||||||
case nodetype of
|
|
||||||
xorn,
|
|
||||||
andn,
|
|
||||||
orn:
|
|
||||||
begin
|
|
||||||
end;
|
end;
|
||||||
ltn,
|
ltn,
|
||||||
lten,
|
lten,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user