MIPS16/GAS: Clean up invalid unextended operand handling
authorMaciej W. Rozycki <macro@imgtec.com>
Fri, 23 Dec 2016 18:06:55 +0000 (18:06 +0000)
committerMaciej W. Rozycki <macro@imgtec.com>
Fri, 23 Dec 2016 19:38:41 +0000 (19:38 +0000)
commit1da43accb4f8e2a19dc033b617982e3c2dc83a08
treeb7e33ea0912ced9dc0e4f9774fe9fe4ebbdb55c4
parentd8722d7641d234dcd3d1f2254fbc5d9cf234e4e6
MIPS16/GAS: Clean up invalid unextended operand handling

Bail out right away when an unextended instruction encoding is required
either with the use of a `.t' suffix or by means of `.set noautoextend',
however an operand supplied requires the extended instruction form to be
used.

This is to avoid messing up with the internal state of the assembler,
even though no actual failures are known to happen as a result.  Add
test cases for the situation concerned.

gas/
* config/tc-mips.c (match_mips16_insn): Don't update
`forced_insn_length' or the instruction opcode if an operand
requires an extended instruction form, but an unextended one
has been requested.
* testsuite/gas/mips/mips16-relax-unextended-1.d: New test.
* testsuite/gas/mips/mips16-relax-unextended-2.d: New test.
* testsuite/gas/mips/mips16-relax-unextended-1.l: New stderr
output.
* testsuite/gas/mips/mips16-relax-unextended-2.l: New stderr
output.
* testsuite/gas/mips/mips16-relax-unextended-1.s: New test
source.
* testsuite/gas/mips/mips16-relax-unextended-2.s: New test
source.
* testsuite/gas/mips/mips.exp: Run the new tests.
gas/ChangeLog
gas/config/tc-mips.c
gas/testsuite/gas/mips/mips.exp
gas/testsuite/gas/mips/mips16-relax-unextended-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips16-relax-unextended-1.l [new file with mode: 0644]
gas/testsuite/gas/mips/mips16-relax-unextended-1.s [new file with mode: 0644]
gas/testsuite/gas/mips/mips16-relax-unextended-2.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips16-relax-unextended-2.l [new file with mode: 0644]
gas/testsuite/gas/mips/mips16-relax-unextended-2.s [new file with mode: 0644]