[Top] [All Lists]

Re: [Patch] / 0 should send SIGFPE not SIGTRAP...

To: "Maciej W. Rozycki" <>
Subject: Re: [Patch] / 0 should send SIGFPE not SIGTRAP...
From: David Daney <>
Date: Wed, 23 Jun 2004 12:30:06 -0700
Cc:, Ralf Baechle <>,,
In-reply-to: <>
Original-recipient: rfc822;
References: <> <> <> <> <mailpost.1086981251.16853@news-sj1-1> <> <>
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031030
Maciej W. Rozycki wrote:

On Fri, 11 Jun 2004 wrote:

in retrospect, the 'B' variation probably wasn't the greatest idea.

If it were removed (leaving 'c' and 'c','q' variations), I don't know
that any real harm would occur.

It may be very confusing to people who expect that the break code will
translate into the instruction in an obvious way, and obviously it
would mess up use of 20-bit codes, but i don't know how prevalent that

Unfortunately, at this point, Linux should probably accept the
divide-by-zero code in both locations.

(Really, from day one, assemblers probably should have accepted a
20-bit code.  I just checked my copy of the Kane r2000/r3000 book, and
it was 20-bit all the way back then.  If i had to guess, i'd guess
that gas was copying a non-gnu assembler's behaviour.  In any case,
water under the bridge.)

As it's at least annoying to have different break codes for divisions expanded by gcc explicitly and ones created implicitly by gas, here's the most reasonable (IMO) approach to fix that. I think it should have been implemented this way originally (if at all).

2004-06-22  Maciej W. Rozycki  <>

        * gas/mips/break20.s: Test the "break20" alias.
        * gas/mips/break20.d: Results for the test.
        * gas/mips/mips32.s: Replace "break" with "break20".
        * gas/mips/set-arch.s: Likewise.
        * gas/mips/mips32.d: Adjust for the new output.
        * gas/mips/set-arch.d: Likewise.

2004-06-22  Maciej W. Rozycki  <>

* mips-opc.c (mips_builtin_opcodes): Replace the MIPS32 ISA specific "break" encoding with a "break20" alias accepted for any ISA.

Just out of curiosity, do you propose this patch in lieu of the patch to Linux's traps.c?

Or would you do both?

It seems like both would be best, as there are already "broken" binutils floating around out there.

Also nobody has objected to the kernel patch...

David Daney.

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