open-watcom / open-watcom-v2

Open Watcom V2.0 - Source code repository, Wiki, Latest Binary build, Archived builds including all installers for download.
Other
977 stars 159 forks source link

Code generator damage conflict information during instruction reduction #515

Open jmalak opened 5 years ago

jmalak commented 5 years ago

The following issues report problems which are caused by this bug

334 #496

jmalak commented 5 years ago

In the past it was partialy identified. Source of problem is damaged confict information. This issue appears only for specific source code growseg.c compilation and a few others. For details see insutil.c function ReplIns. The problem is that existing instruction handling on some places (not identified yet) damage conflict information which are used by register allocation routines. We can identify this damage by FreeIns function where detection code already exists, but is disabled to not break production version. Source of this problem is some incorrect instruction manipulation during reducing some instruction. Need more analysis of crucial part of code generator. Anyway source of this issue is incorrect instruction removing without update conflict information if this instruction is part of conflict. It does not cause incorrect code generation, only register allocation is not optimal for all allocations. Generated code could be eficient as soon as it will be fixed. It is masked in production version because cleaned memory block is zeroed but debug version use 0xDF byte and therefore pointer is NULL for production version but for debug version it is 0xDFDFDFDF. Production version is working without problem (check for NULL pointer), but debug version crash due to wrong pointer value.

jmalak commented 4 years ago

614