Tested on 32-bit PowerPC Debian in QEMU: when compiled with -mregnames, addi r30,r30,r5 becomes addi r30,r30,5 when disassembled. Yes, the instruction expects an immediate as the third argument and add works as expected, but I'd like to get at least a warning. Nothing is printed with -Wall -Werror.
True for current master too.
The master branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=606a935e3a9066ab11308b8c934c9bdec7f128d3 commit 606a935e3a9066ab11308b8c934c9bdec7f128d3 Author: Alan Modra <amodra@gmail.com> Date: Tue Feb 14 20:30:27 2017 +1030 Fix powerpc testsuite source errors PR 21118 work exposed these errors in the testsuite. * testsuite/gas/ppc/cell.s: Correct invalid registers. * testsuite/gas/ppc/vle-simple-1.s: Likewise. * testsuite/gas/ppc/vle-simple-2.s: Likewise.
The master branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7e0de605cbacbbbb2531bb70506c0843aea13111 commit 7e0de605cbacbbbb2531bb70506c0843aea13111 Author: Alan Modra <amodra@gmail.com> Date: Tue Feb 14 20:38:21 2017 +1030 PowerPC register expression checks This stops powerpc gas blithely accepting such nonsense as "addi %f4,%cr3,%r31". PR 21118 gas/ * NEWS: Mention powerpc register checks. * config/tc-ppc.c (struct pd_reg): Make value a short. Add flags. (pre_defined_registers): Delete fpscr and pmr entries. Set register type in flags. (cr_names): Set type in flags. (reg_name_search): Return pointer to struct pd_reg rather than value. (register_name): Adjust to suit. Set X_md from flags. (ppc_parse_name): Likewise. (ppc_optimize_expr): New function. (md_assemble): Verify expresion reg flags match operand. * config/tc-ppc.h (md_optimize_expr): Define. (ppc_optimize_expr): Declare. include/ * opcode/ppc.h (PPC_OPERAND_*): Reassign values, regs first. (PPC_OPERAND_SPR, PPC_OPERAND_GQR): Define. opcodes/ * ppc-opc.c (powerpc_operands): Flag SPR, SPRG and TBR entries with PPC_OPERAND_SPR. Flag PSQ and PSQM with PPC_OPERAND_GQR.
The binutils-2_28-branch branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ce45602b476d30f2ca354691374a092886b64951 commit ce45602b476d30f2ca354691374a092886b64951 Author: Alan Modra <amodra@gmail.com> Date: Tue Feb 14 20:30:27 2017 +1030 Fix powerpc testsuite source errors PR 21118 work exposed these errors in the testsuite. * testsuite/gas/ppc/cell.s: Correct invalid registers. * testsuite/gas/ppc/vle-simple-1.s: Likewise. * testsuite/gas/ppc/vle-simple-2.s: Likewise.
Fixed.
The master branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ece5dcc1c00a48ecf63eae71983d04270cef4280 commit ece5dcc1c00a48ecf63eae71983d04270cef4280 Author: Alan Modra <amodra@gmail.com> Date: Mon Feb 20 12:06:52 2017 +1030 Downgrade powerpc register error to warning PR 21118 * NEWS: Revise powerpc register check. * config/tc-ppc.c (ppc_optimize_expr, md_assemble): Make "invalid register expression" a warning.
The master branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=4b1c0f7e85f2aec3df3498d04b5beaf45813dea8 commit 4b1c0f7e85f2aec3df3498d04b5beaf45813dea8 Author: Alan Modra <amodra@gmail.com> Date: Tue Dec 12 10:56:23 2017 +1030 Don't mask X_add_number containing a register number It's obviously wrong to mask SPRs to 8 bits. PR 21118 * config/tc-ppc.c (md_assemble): Don't mask register number.
The binutils-2_29-branch branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b2bcbfb760e747cf811e4756ce396e973e7094ae commit b2bcbfb760e747cf811e4756ce396e973e7094ae Author: Alan Modra <amodra@gmail.com> Date: Tue Dec 12 10:56:23 2017 +1030 Don't mask X_add_number containing a register number It's obviously wrong to mask SPRs to 8 bits. PR 21118 * config/tc-ppc.c (md_assemble): Don't mask register number. (cherry picked from commit 4b1c0f7e85f2aec3df3498d04b5beaf45813dea8)