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: Michael Veksler <mveksler at techunix dot technion dot ac dot il>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 16 Jan 2007 14:00:25 +0000
- Subject: Re: Miscompilation of remainder expressions
- References: <45AB8770.5040402@cs.unipr.it> <45ABE54F.2010505@tx.technion.ac.il>
Michael Veksler writes:
> 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)?
> > All the best,
> >
> This problem is quite rare in practice (otherwise there would be
> much more complaining). As such it may be too expensive,
> performance-wise, to fix in GCC. It seems as one of those
> classical things that can be worked-around in the kernel.
I guess, or it can be fixed-up in user space. We already do this for
the Java language.
Andrew.