From 0fd7a5cb1fb05d0ee521c98cdcff695e95194b79 Mon Sep 17 00:00:00 2001 From: florian Date: Thu, 24 Dec 2020 13:13:42 +0000 Subject: [PATCH] * lines with 255 chars a little bit long, reformated them git-svn-id: trunk@47845 - --- compiler/nflw.pas | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/compiler/nflw.pas b/compiler/nflw.pas index 5e9d248003..527484385a 100644 --- a/compiler/nflw.pas +++ b/compiler/nflw.pas @@ -1607,7 +1607,8 @@ implementation } if (cs_opt_level2 in current_settings.optimizerswitches) and - (left.nodetype in [gtn,gten,ltn,lten]) and IsSingleStatement(right,thenstmnt) and ((t1=nil) or IsSingleStatement(t1,elsestmnt)) and + (left.nodetype in [gtn,gten,ltn,lten]) and IsSingleStatement(right,thenstmnt) and + ((t1=nil) or IsSingleStatement(t1,elsestmnt)) and (thenstmnt.nodetype=assignn) and ((t1=nil) or (elsestmnt.nodetype=assignn)) and not(might_have_sideeffects(left)) and ((t1=nil) or tassignmentnode(thenstmnt).left.isequal(tassignmentnode(elsestmnt).left)) and @@ -1623,16 +1624,36 @@ implementation {$if defined(xtensa)} (CPUXTENSA_HAS_MINMAX in cpu_capabilities[current_settings.cputype]) and is_32bitint(tassignmentnode(thenstmnt).right.resultdef) and {$endif defined(xtensa)} + ( { the right size of the assignment in the then clause must either } - { equal to the left ... } { ... and the else clause must be either not exist } { or the else clause exists and the right side of the assignment in the else clause } - { and the left side of the assignment in the then clause must be } { must be equal to the right side of the comparison operator } - { equal to the right operand of the comparison operator } - ((tassignmentnode(thenstmnt).right.isequal(taddnode(left).left) and (((t1=nil) and (tassignmentnode(thenstmnt).left.isequal(taddnode(left).right))) or (assigned(elsestmnt) and tassignmentnode(elsestmnt).right.isequal(taddnode(left).right)))) or - { ... or right operand of the comparison operator } { ... and the else clause must be either not exist } { or the else clause exists and the right side of the assignment in the else clause } - { and the left side of the assignment in the then clause must be } { must be equal to the left side of the comparison operator } - { equal to the left operand of the comparison operator } - (tassignmentnode(thenstmnt).right.isequal(taddnode(left).right) and (((t1=nil) and (tassignmentnode(thenstmnt).left.isequal(taddnode(left).left))) or (assigned(elsestmnt) and tassignmentnode(elsestmnt).right.isequal(taddnode(left).left)))) + { equal to the left ... } + (tassignmentnode(thenstmnt).right.isequal(taddnode(left).left) and + + { ... and the else clause must be either not exist } + { and the left side of the assignment in the then clause must be } + { equal to the right operand of the comparison operator } + ( + ((t1=nil) and (tassignmentnode(thenstmnt).left.isequal(taddnode(left).right))) or + + { or the else clause exists and the right side of the assignment in the else clause } + { must be equal to the right side of the comparison operator } + (assigned(elsestmnt) and tassignmentnode(elsestmnt).right.isequal(taddnode(left).right))) + ) or + { ... or right operand of the comparison operator } + + (tassignmentnode(thenstmnt).right.isequal(taddnode(left).right) and + { ... and the else clause must be either not exist } + { and the left side of the assignment in the then clause must be } + { equal to the left operand of the comparison operator } + ( + ((t1=nil) and (tassignmentnode(thenstmnt).left.isequal(taddnode(left).left))) or + + { or the else clause exists and the right side of the assignment in the else clause } + { must be equal to the left side of the comparison operator } + (assigned(elsestmnt) and tassignmentnode(elsestmnt).right.isequal(taddnode(left).left)) + ) + ) ) then begin paratype:=tassignmentnode(thenstmnt).left.resultdef;