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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Maciej W. Rozycki wrote:

On Fri, 11 Jun 2004 cgd@xxxxxxxxxxxx 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
is.

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).


gas/testsuite/:
2004-06-22  Maciej W. Rozycki  <macro@xxxxxxxxxxxxx>

	* 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.

opcodes/:
2004-06-22  Maciej W. Rozycki  <macro@xxxxxxxxxxxxx>

* 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.





[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux