Joe Buck <[EMAIL PROTECTED]> writes: > I suggest that those who think this is a severe problem are the ones who > are highly motivated to work on a solution. An efficient solution could > be tricky: you don't want to disrupt pipelines, or interfere with > optimizations that rely on recognizing that there is a modulo.
I suspect that the best fix, in the sense of generating the best code, would be to do this at the tree level. That will give loop and VRP optimizations the best chance to eliminate the test for -1. Doing it during gimplification would be easy, if perhaps rather ugly. If there are indeed several processors with this oddity, then it would even make a certain degree of sense as a target-independent option. If we think it's too ugly to do it in the target independent code, then it's trivial to do it by changing the divmodsi4 define_expand in config/i386/i386.md. Ian