This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Miscompilation of remainder expressions
- From: Vincent Lefevre <vincent+gcc at vinc17 dot org>
- To: Robert Dewar <dewar at adacore dot com>
- Cc: Roberto Bagnara <bagnara at cs dot unipr dot it>, gcc at gcc dot gnu dot org
- Date: Tue, 16 Jan 2007 22:03:56 +0100
- Subject: Re: Miscompilation of remainder expressions
- References: <45AB8770.5040402@cs.unipr.it> <45AD0BD4.9090809@adacore.com>
On 2007-01-16 12:31:00 -0500, Robert Dewar wrote:
> Roberto Bagnara wrote:
> >Reading the thread "Autoconf manual's coverage of signed integer
> >overflow & portability" I was horrified to discover about GCC's
> >miscompilation of the remainder expression that causes INT_MIN % -1
> >to cause a SIGFPE on CPUs of the i386 family. Are there plans to
> >fix this bug (which, to me, looks quite serious)?
>
> Seems ultra-non-serious to me, hard to believe this case appears
> in real code, despite surprising claim by Roberto.
What makes you think so?
One never knows. We (the MPFR developers) found several compiler bugs
concerning particular cases like that, which occurred in MPFR. One of
them (in some gcc version) was 0 + LONG_MIN, which was different from
LONG_MIN. Is 0 + LONG_MIN so different from INT_MIN % -1, for instance?
--
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)