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
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.
Generate code to take a break exception rather than a trap
exception when an error is detected. This is the default.