[Top] [All Lists]

[RFC] MIPS division by zero and libgcj...

To: David Daney <>,,,
Subject: [RFC] MIPS division by zero and libgcj...
From: Andrew Haley <>
Date: Thu, 10 Jun 2004 20:39:25 +0100
In-reply-to: <>
Original-recipient: rfc822;
References: <> <>
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.


<Prev in Thread] Current Thread [Next in Thread>