This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Miscompilation of remainder expressions
- From: Andrew Haley <aph at redhat dot com>
- To: Roberto Bagnara <bagnara at cs dot unipr dot it>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 15 Jan 2007 14:07:10 +0000
- Subject: Re: Miscompilation of remainder expressions
- References: <45AB8770.5040402@cs.unipr.it>
Roberto Bagnara writes:
>
> 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)?
No, there aren't. It would make more sense for you to wrap % in some
code that checks for this, rather than for us to slow down every division
for this one special case.
Andrew.