diff --git a/.gitattributes b/.gitattributes index 8aae5d880f..12ec9d4546 100644 --- a/.gitattributes +++ b/.gitattributes @@ -17736,6 +17736,7 @@ tests/webtbs/tw33548.pp svneol=native#text/plain tests/webtbs/tw3356.pp svneol=native#text/plain tests/webtbs/tw33563.pp svneol=native#text/pascal tests/webtbs/tw33564.pp svneol=native#text/pascal +tests/webtbs/tw33565.pp -text svneol=native#text/pascal tests/webtbs/tw3360.pp svneol=native#text/plain tests/webtbs/tw33607.pp svneol=native#text/plain tests/webtbs/tw33635.pp svneol=native#text/pascal diff --git a/compiler/rgobj.pas b/compiler/rgobj.pas index 028a9aff48..b682f34485 100644 --- a/compiler/rgobj.pas +++ b/compiler/rgobj.pas @@ -2047,29 +2047,6 @@ unit rgobj; internalerror(2015040501); {$endif} setsupreg(reg,u); - { - Remove sequences of release and - allocation of the same register like. Other combinations - of release/allocate need to stay in the list. - - # Register X released - # Register X allocated - } - if assigned(previous) and - (ratype=ra_alloc) and - (Tai(previous).typ=ait_regalloc) and - (Tai_regalloc(previous).reg=reg) and - (Tai_regalloc(previous).ratype=ra_dealloc) then - begin - q:=Tai(next); - hp:=tai(previous); - list.remove(hp); - hp.free; - list.remove(p); - p.free; - p:=q; - continue; - end; end; end; end; diff --git a/tests/webtbs/tw33565.pp b/tests/webtbs/tw33565.pp new file mode 100644 index 0000000000..26b53e414f --- /dev/null +++ b/tests/webtbs/tw33565.pp @@ -0,0 +1,32 @@ +{ %OPT=-O- -OoREGVAR -Oolevel1 -Cr -Mobjfpc -Oopeephole } +program app_test_core; + +uses + + SysUtils, Classes; + + procedure SetMemory(Stream: TStream; var P: Pointer; var PSize: Integer); + begin + PSize := Stream.Size; + GetMem(P, PSize); + Stream.Position := 0; + Stream.Read(P^, PSize); + end; + +var + M: TMemoryStream; + L, V: Integer; + P: Pointer; +begin + M := TMemoryStream.Create; + V := -1; + M.Write(V, SizeOf(V)); + M.Position := 0; + + P := nil; + L := 0; + SetMemory(M, P, L); + FreeMem(P); + + M.Free; +end.