This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Miscompilation of remainder expressions
- From: Joe Buck <Joe dot Buck at synopsys dot COM>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: Gabriel Dos Reis <gdr at cs dot tamu dot edu>, Vincent Lefevre <vincent+gcc at vinc17 dot org>, gcc at gcc dot gnu dot org
- Date: Tue, 16 Jan 2007 16:12:01 -0800
- Subject: Re: Miscompilation of remainder expressions
- References: <87vej6il6o.fsf@soliton.cs.tamu.edu> <200701162355.l0GNtk4s017536@localhost.localdomain>
On Tue, Jan 16, 2007 at 06:55:45PM -0500, Andrew Pinski wrote:
> >
> > Vincent Lefevre <vincent+gcc@vinc17.org> writes:
> >
> > | On 2007-01-16 13:41:16 -0800, Ian Lance Taylor wrote:
> > | > To be clear, in my opinion, this should always be selected by an
> > | > option, it should never be default behaviour for any target.
> > |
> > | I disagree. One should get correct results by default.
> >
> > Once we have an implemented solution, we can quibble over whether it
> > should be on by default or not. That debate will be supported by
> > sample of hard data. Once we have an implementation.
>
> I wonder why the call to div/ldiv/lldiv says the behavior is undefined while
> % is defined, that seems wrong.
>
> The specific wording from the standard is "If either part of the result
> cannot be represented, the behavior is undefined." So why is % different
> from those functions?
Let's keep the two issues separate. Clearly some users want a solution;
if people are willing to contribute a solution we should accept it.
There appears to be controversy over the language requirement. If a
solution is contributed, then the default setting of the switch (whether
on or off by default) is a separate matter. We might even consider doing
a survey: what do the users want?
Benchmark wars might also have an impact. Does icc generate a SIGFPE?
What's the effect on benchmarks? Some users might want to pay the price
to be sure the trap is avoided, others might not.