[Patch] Optimisation fix for Internal Error 201810201
Original Reporter info from Mantis: CuriousKit @CuriousKit
-
Reporter name: J. Gareth Moreton
Original Reporter info from Mantis: CuriousKit @CuriousKit
- Reporter name: J. Gareth Moreton
Description:
This patch fixes an Internal Error that occurred when cross-compiling from x86_64-win64 to m68k-amiga and other m68k platforms.
Steps to reproduce:
Apply patch and confirm successful cross-compilation.
Additional information:
The And2Nop optimisation was actually sound, but it caused another optimisation to malfunction, namely MovOpMov2MovOp -for example, in hlcgobj:
(Without optimisation)
...
movl %ebx,%eax
notl %eax
andl %eax,%eax
movq %rax,%r8
...
(With optimisation) # Peephole Optimization: MovOpMov2MovOp (movl notl movq) movq %rbx,%r8 notq %r8 # Peephole Optimization: And2Nop
This caused problems because the upper 32-bits of %rbx might not be zero. The fix now forces the instructions to S_L size in this situation.
Mantis conversion info:
- Mantis ID: 38247
- OS: Ubuntu Linux
- OS Build: 20.04.1 LTS
- Build: r47836
- Platform: x86_64 cross-compiling to m68k
- Version: 3.3.1
- Fixed in version: 3.3.1
- Fixed in revision: 47838 (#2bcd2a4a)
- Target version: 4.0.0