Open beketata opened 4 years ago
I was having a vaguely similar issue (many unreachable code blocks). Workaround was to edit the memory areas to set "SFR-BITS" to volatile . This should be fixed at the .pspec level if possible ?
This probably applies to #3061 as well.
Describe the bug Decompilation result for a simple 8051 code is wrong.
To Reproduce C source code sample compiled in Keil:
Decompilation result is:
Actually there are two issues in the decompiled code:
SCON.TI bit is not checked in the timeout cycle. Not only SBUF is volatile, but TI also is. So, there is no unreachable block in code.
while ((BANK0_R4 < 0x37U - ((bVar1 << 7) >> 7)) << 7 < '\0'); instead of while( wr++ < 0x37CD ); is awful.
Expected behavior As original C source code.
Attachments Raw binary zipped file
Environment: