This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
[RFC] MIPS division by zero and libgcj...
Andrew Haley writes:
> David Daney writes:
> > It appears that gcc configured for mipsel-linux will execute a "break 7"
> > instruction on integer division by zero.
>
> I thought that the MIPS never generated a hardware trap for division,
> but instead there was an assembler macro that did the test for
> overflow, and the "div" instruction actually generates this test
> inline. Maybe do a disassembly to check.
Here we are:
MIPS Dependent Features
--trap
--no-break
automatically macro expands certain division and multiplication
instructions to check for overflow and division by zero. This
option causes to generate code to take a trap exception rather
than a break exception when an error is detected. The trap
instructions are only supported at Instruction Set Architecture
level 2 and higher.
--break
--no-trap
Generate code to take a break exception rather than a trap
exception when an error is detected. This is the default.
Andrew.