[Patch] i386: tcnvint1 bug fix
The file tcnvint1-fix.patch corrects an issue with the code generator where the flags register was not properly tracked. This caused a peephole optimisation to malfunction under -O2 (but not -O1 or -O3, probably due to constant propagation).
Criteria
Apply patch, confirm correct compilation and successful resolution of the tcnvint1 test when compiled with -O2.
Additional
Some other unrelated tests now successfully compile. This is possibly due to the correction fixing some bad machine code in the compiler itself.
The file tcnvint1-peephole-extension.patch adds a peephole optimisation that permits the malfunctioning peephole optimisation (which was otherwise correct based on the information it had) to operate more extensively with the bug fix applied: before, MOV 0 / OR -> MOV would not be applied if the flags register was in use, but now it will if it's able to modify any subsequent Jcc, SETcc or CMOVcc instructions based on if the condition is always true (in which case they are turned into JMP, MOV 1 and MOV respectively) or false (in which case, jumps and CMOVs are removed completely, whereas SETcc becomes MOV 0).
It's worth noting that under -O3 and -O4, the code generator is slightly less efficient because the resultant machine code on line 199 of tcnvint1.pp is "xorw %ax,%ax", even though %ax is deallocated at the same time and hence the register is not in use, whereas under -O2, the line is removed completely. tcnvint1-fix.patchtcnvint1-peephole-extension.patch