This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: RFA PATCH: Enable MIPS SIGFPE handling...
Andrew Haley wrote:
> David Daney writes:
> > Andrew Haley wrote:
> > > David Daney writes:
> > > > When I made my initial series of MIPS patches my misunderstanding of how
> > > > GCC generates divide by zero checks led me to omit SIGFPE handling.
> > > >
> > > > Now since I have seen the light, I present this patch to enable use of
> > > > SIGFPE for generation of ArithmeticException("/ by zero");
> > > >
> > > >
> > > > Tested on --host=i686-pc-linux-gnu --target=mipsel-linux with no
> > > > regressions in top level make check.
> > > >
> > > > And yes it is correct to #undef HANDLE_DIVIDE_OVERFLOW as MIPS does
> > > > division according to the JLS without any of the mickey-mouse stuff that
> > > > has to be done with the x86.
>
> IOW, it replicates the bug... :-)
>
> > > >
> > > > O.K to commit?
> > > >
> > > > David Daney.
> > > > 2004-09-03 David Daney <ddaney@avtrex.com>
> > > >
> > > > * configure.host: Use -fno-use-divide-subroutine for mips*-*-linux*.
> > > > * include/mips-signal.h: Added HANDLE_FPE support.
> > >
> > > Where does the saved PC in the sigcontext point to when a divide
> > > overflow happens? The trap instruction, or the instruction after?
> >
> > To the best of my knowledge, it points to the teq/break instruction.
>
> Well, it is important! If so, the definition of MAKE_THROW_FRAME is
> fine.
Of course it is important. But FWIW GCC currently does not generate the
teq/break as the first instruction so even without incrementing the PC
in the sigcontext unwinding would happen correctly.
> Approved.
>
Committed
David Daney.