This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the EGCS project.
Re: PATCH for loop.c, SIGFPE with bad integer operands on host (linux-)ix86
- To: law@cygnus.com
- Subject: Re: PATCH for loop.c, SIGFPE with bad integer operands on host (linux-)ix86
- From: Andrew Haley <aph@pasanda.cygnus.co.uk>
- Date: 4 Aug 1999 07:11:47 -0000
- CC: hp@bitrange.com, gcc-patches@gcc.gnu.org, krister.walfridsson@precisebiometrics.com, lars.malmborg@precisebiometrics.com
> Date: Tue, 03 Aug 1999 18:09:31 -0600
> From: Jeffrey A Law <law@cygnus.com>
>
> In message <Pine.BSF.4.10.9908031834570.14732-100000@dair.pair.com>you write:
> > There's a (well-known?) problem with integer arithmetic on
> > (linux-)ix86 platforms: Doing signed integer modulus or
> > division on (0x80000000 / -1) or (0x80000000 % -1) gives a
> > SIGFPE. This is ix86-specific, and maybe possible to work
> > around in the right interrupt handler in the kernel for
> > those who know that stuff. This happens on linux 2.0.30
> > with a PPro as well as on linux 2.2.1 with a PII, and
> > probably on non-linux systems as well; I believe cygwin b20.1
> > has the same problem.
> The kernel trap handlers need to be fixed.
Well, maybe. However, efficient Java implementation requires
language-specific handling of this case. Other programming languages
may also require handlers, for all I know. It would be a Bad Thing if
the kernel were to fail to send SIGFPE to a running Java application,
as we'd have to put a test around every divide instruction.
I suggest that gcc should not try to do a signed integer division in
this case as the result isn't portably defined.
Andrew.