decimalst/optimice

CMP upfront pushf is acidentily remove by dead code elimination

Closed this issue · 2 comments

What steps will reproduce the problem?
The code:
push    ebp             ; OPTY@[00001060];
mov     ebp, esp
push    ebx
push    esi
push    edi
pop     eax
cmp     ecx, eax
pushf
xor     eax, eax
pop     edi
pop     esi
pop     ebx
pop     ebp
retn

will be optimised to:
push    ebp             ; Origin@[00401010];
mov     ebp, esp
push    ebx
push    esi
mov     eax, edi
pushf
xor     eax, eax
pop     edi
pop     esi
pop     ebx
pop     ebp
retn


What is the expected output? What do you see instead?
push    ebp             ; Origin@[00401010];
mov     ebp, esp
push    ebx
push    esi
mov     eax, edi
cmp     ecx, eax
pushf
xor     eax, eax
pop     edi
pop     esi
pop     ebx
pop     ebp
retn


What version of the product are you using? On what operating system?
V0.13

Please provide any additional information below.
The CMP instruction is changing the FLAGS, that are pushed next.
So I thing the CMP shall not be removed as "dead code"

Original issue reported on code.google.com by Ralf_Bra...@gmx.de on 12 Dec 2011 at 11:34

I just checked out source version R8
This is no longer a problem with the latest code

Original comment by Ralf_Bra...@gmx.de on 14 Dec 2011 at 11:00

Made some additional improvements to handling this case, check the latest svn 
code.

Original comment by glj...@gmail.com on 18 Jan 2012 at 9:45

  • Changed state: Verified