]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
MIPS/GAS: Fix an ISA override not lifting ABI restrictions binutils-2_25-branch
authorMaciej W. Rozycki <macro@imgtec.com>
Fri, 22 Apr 2016 00:04:52 +0000 (01:04 +0100)
committerMaciej W. Rozycki <macro@imgtec.com>
Wed, 29 Jun 2016 03:08:27 +0000 (04:08 +0100)
commit8f2db47d13b6afdba8e7b09a01ac2a0ca41d708e
treef3701d2d543ccb93d62275b286a0f6e516f9e927
parentb9dfae3c245cc41f95bc4158e6f656ada65397ca
MIPS/GAS: Fix an ISA override not lifting ABI restrictions

Correct a regression introduced with commit 919731affbef ("Add MIPS
.module directive") causing code like:

.set mips3
dli $2, 0x9000000080000000

to fail assembly with the following error message produced:

Error: number (0x9000000080000000) larger than 32 bits

if built with `mips3' selected as the global ISA (e.g. `-march=mips3').
This is because a `.set' directive doing an ISA override does not lift
the ABI restriction on register sizes if the ISA remains unchanged.
Previously the directive always set register sizes from the ISA chosen,
which is what some code expects.  Restore the old semantics then.

gas/
* config/tc-mips.c (code_option_type): New enum.
(parse_code_option): Return status indicating option type.
(s_mipsset): Update `parse_code_option' call site accordingly.
Always set register sizes from the ISA with ISA overrides.
(s_module): Update `parse_code_option' call site.
* testsuite/gas/mips/isa-override-1.d: New test.
* testsuite/gas/mips/micromips@isa-override-1.d: New test.
* testsuite/gas/mips/mips1@isa-override-1.d: New test.
* testsuite/gas/mips/mips2@isa-override-1.d: New test.
* testsuite/gas/mips/mips32@isa-override-1.d: New test.
* testsuite/gas/mips/mips32r2@isa-override-1.d: New test.
* testsuite/gas/mips/mips32r3@isa-override-1.d: New test.
* testsuite/gas/mips/mips32r5@isa-override-1.d: New test.
* testsuite/gas/mips/mips32r6@isa-override-1.d: New test.
* testsuite/gas/mips/mips64r2@isa-override-1.d: New test.
* testsuite/gas/mips/mips64r3@isa-override-1.d: New test.
* testsuite/gas/mips/mips64r5@isa-override-1.d: New test.
* testsuite/gas/mips/mips64r6@isa-override-1.d: New test.
* testsuite/gas/mips/r3000@isa-override-1.d: New test.
* testsuite/gas/mips/r3900@isa-override-1.d: New test.
* testsuite/gas/mips/r5900@isa-override-1.d: New test.
* testsuite/gas/mips/octeon@isa-override-1.d: New test.
* testsuite/gas/mips/octeon3@isa-override-1.d: New test.
* testsuite/gas/mips/isa-override-2.l: New list test.
* testsuite/gas/mips/mips1@isa-override-2.l: New list test.
* testsuite/gas/mips/mips2@isa-override-2.l: New list test.
* testsuite/gas/mips/mips32@isa-override-2.l: New list test.
* testsuite/gas/mips/mips32r2@isa-override-2.l: New list test.
* testsuite/gas/mips/mips32r3@isa-override-2.l: New list test.
* testsuite/gas/mips/mips32r5@isa-override-2.l: New list test.
* testsuite/gas/mips/mips32r6@isa-override-2.l: New list test.
* testsuite/gas/mips/r3000@isa-override-2.l: New list test.
* testsuite/gas/mips/r3900@isa-override-2.l: New list test.
* testsuite/gas/mips/octeon3@isa-override-2.l: New list test.
* testsuite/gas/mips/octeon3@isa-override-1.l: New stderr
output.
* testsuite/gas/mips/isa-override-1.s: New test source.
* testsuite/gas/mips/r5900@isa-override-1.s: New test source.
* testsuite/gas/mips/isa-override-2.s: New test source.
* testsuite/gas/mips/mips1@isa-override-2.s: New test source.
* testsuite/gas/mips/mips2@isa-override-2.s: New test source.
* testsuite/gas/mips/mips32@isa-override-2.s: New test source.
* testsuite/gas/mips/mips32r2@isa-override-2.s: New test source.
* testsuite/gas/mips/mips32r3@isa-override-2.s: New test source.
* testsuite/gas/mips/mips32r5@isa-override-2.s: New test source.
* testsuite/gas/mips/mips32r6@isa-override-2.s: New test source.
* testsuite/gas/mips/r3000@isa-override-2.s: New test source.
* testsuite/gas/mips/r3900@isa-override-2.s: New test source.
* testsuite/gas/mips/octeon3@isa-override-2.s: New test source.
* testsuite/gas/mips/mips.exp: Run the new tests.

(cherry picked from commit 5475e3249a6ab15afa0fe00456ada988d940a302)
46 files changed:
gas/ChangeLog
gas/config/tc-mips.c
gas/testsuite/gas/mips/isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/isa-override-1.s [new file with mode: 0644]
gas/testsuite/gas/mips/isa-override-2.l [new file with mode: 0644]
gas/testsuite/gas/mips/isa-override-2.s [new file with mode: 0644]
gas/testsuite/gas/mips/micromips@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips.exp
gas/testsuite/gas/mips/mips1@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips1@isa-override-2.l [new file with mode: 0644]
gas/testsuite/gas/mips/mips1@isa-override-2.s [new file with mode: 0644]
gas/testsuite/gas/mips/mips2@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips2@isa-override-2.l [new file with mode: 0644]
gas/testsuite/gas/mips/mips2@isa-override-2.s [new file with mode: 0644]
gas/testsuite/gas/mips/mips32@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips32@isa-override-2.l [new file with mode: 0644]
gas/testsuite/gas/mips/mips32@isa-override-2.s [new file with mode: 0644]
gas/testsuite/gas/mips/mips32r2@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips32r2@isa-override-2.l [new file with mode: 0644]
gas/testsuite/gas/mips/mips32r2@isa-override-2.s [new file with mode: 0644]
gas/testsuite/gas/mips/mips32r3@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips32r3@isa-override-2.l [new file with mode: 0644]
gas/testsuite/gas/mips/mips32r3@isa-override-2.s [new file with mode: 0644]
gas/testsuite/gas/mips/mips32r5@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips32r5@isa-override-2.l [new file with mode: 0644]
gas/testsuite/gas/mips/mips32r5@isa-override-2.s [new file with mode: 0644]
gas/testsuite/gas/mips/mips32r6@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips32r6@isa-override-2.l [new file with mode: 0644]
gas/testsuite/gas/mips/mips32r6@isa-override-2.s [new file with mode: 0644]
gas/testsuite/gas/mips/mips64r2@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips64r3@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips64r5@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips64r6@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/octeon3@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/octeon3@isa-override-1.l [new file with mode: 0644]
gas/testsuite/gas/mips/octeon3@isa-override-2.l [new file with mode: 0644]
gas/testsuite/gas/mips/octeon3@isa-override-2.s [new file with mode: 0644]
gas/testsuite/gas/mips/octeon@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/r3000@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/r3000@isa-override-2.l [new file with mode: 0644]
gas/testsuite/gas/mips/r3000@isa-override-2.s [new file with mode: 0644]
gas/testsuite/gas/mips/r3900@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/r3900@isa-override-2.l [new file with mode: 0644]
gas/testsuite/gas/mips/r3900@isa-override-2.s [new file with mode: 0644]
gas/testsuite/gas/mips/r5900@isa-override-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/r5900@isa-override-1.s [new file with mode: 0644]