This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Miscompilation of remainder expressions


Andrew Haley wrote:
Ian Lance Taylor writes:
> Joe Buck <Joe.Buck@synopsys.COM> 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.


x86, x86-64, S/390, as far as I'm aware.


MIPS does *not* seem to suffer from this 'defect', so a target independent solution that caused MIPS to generate worse code would be bad.


David Daney


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]