[Patch] Minor oversight in MovAnd2Mov 3 optimisation
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:
An x86 optimisation with MOV/AND pairs does not set Result to True in order to indicate that pass 1 needs to run another iteration in order for all optimisations to be caught. This is partially disguised by the fact that pass 1 is always given an additional pass at the end, but is a little bit inconsistent, and can cause slight code differences if this additional pass is removed (experimental branch of mine), even under -O4 where no optimisations should be missed.
Steps to reproduce:
Apply patch and confirm correct compilation.
Additional information:
Can someone explain the necessity of the "aoc_MovAnd2Mov_3" flag? This disables the optimisation until a particular AND optimisation takes place (where Result was not set). It has an element of 'code smell' to me, because if an optimisation should not be performed until a particular set of circumstances, then I would argue that it should be moved to pass 2 instead. Setting the flag also affects ALL of the MOV/AND optimisations for the current procedure, not just the one that the AND instruction is a part of.
Mantis conversion info:
- Mantis ID: 37442
- OS: Microsoft Windows
- OS Build: 10 Professional
- Build: r45865
- Platform: i386 and x86_64
- Version: 3.3.1
- Fixed in version: 3.3.1