From 460dd1c10a626ea959a4082061c2f9ab20d81508 Mon Sep 17 00:00:00 2001 From: nickysn Date: Fri, 12 May 2017 11:40:06 +0000 Subject: [PATCH] * remove the redundant equal typeconv, left over as an artifact after removing the unnecessary widening of intermediary calculations to 64-bit. This allows, among other things, the x:=x+k optimization to be applied in the case of signed32:=signed32+unsigned32 types. git-svn-id: trunk@36191 - --- compiler/ncnv.pas | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/compiler/ncnv.pas b/compiler/ncnv.pas index 8ffb3b2178..721f8e6b77 100644 --- a/compiler/ncnv.pas +++ b/compiler/ncnv.pas @@ -3064,6 +3064,14 @@ implementation checkremovebiginttypeconvs(left,foundsint,[s8bit,u8bit],int64(low(shortint)),high(byte)) then doremoveinttypeconvs(left,generrordef,not foundsint,s8inttype,u8inttype); {$endif defined(cpu8bitalu)} + { the above simplification may have left a redundant equal + typeconv (e.g. int32 to int32). If that's the case, we remove it } + if equal_defs(left.resultdef,resultdef) then + begin + result:=left; + left:=nil; + exit; + end; end; end; end;