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


On Tue, Jan 16, 2007 at 11:05:20AM -0800, David Daney wrote:
> Roberto Bagnara wrote:
> >
> >Hmmm, it says nothing about the remainder.  Can some Google guru
> >suggest how to prove or disprove the claim that what we are
> >talking about is wildly known?
> >
> 
> The point really is not how widely/wildly known the issue is.  Really 
> the thing we consider on gcc@ is:  What is the 'best' thing for GCC and 
> the GCC developers to do.
> 
> I don't claim to speak for others, but until now this issue has not 
> seemed all that pressing.  And it still doesn't.

We can talk about this forever, but how about moving to a resolution?

First off, is there a PR for this bug?  Second, if it were to be fixed,
what is the fix that minimizes the extra overhead?  I suspect that many
users would not want the fix if it slows down integer modulo
significantly, or if they are already coding defensively because they know
about the issue, but that some users *would* want it.

The final solution would be a fix that is enabled by some flag.  We can
then have another argument as to the name of the flag and when it is
enabled.

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 don't think anyone would object if there were a non-default option to
ensure that anything % -1 is zero and does not trap, especially if the
overhead were small.  So Roberto, how about it?  Would you like to work on
that?  Any other volunteers?  You can't expect those who don't see it as
a serious problem to volunteer, not with so many other open bugs.





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