From patchwork Mon Nov 11 08:41:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Arm64: fix build with old glibc X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 26379 Message-Id: <95dfcc31-5cc0-6d1f-8d0d-813743a46f95@suse.com> To: "binutils@sourceware.org" Cc: Richard Earnshaw , Marcus Shawcroft Date: Mon, 11 Nov 2019 09:41:43 +0100 From: Jan Beulich List-Id: Some old glibc versions have string.h surface "index", which some compilers then warn about if shadowed by a local variable. Re-use an existing variable instead. opcodes/ 2019-11-11 Jan Beulich * aarch64-opc.c (operand_general_constraint_met_p): Replace "index" local variable by that of the already existing "num". --- a/opcodes/aarch64-opc.c +++ b/opcodes/aarch64-opc.c @@ -2544,17 +2544,14 @@ operand_general_constraint_met_p (const case AARCH64_OPND_SVE_SHRIMM_PRED: case AARCH64_OPND_SVE_SHRIMM_UNPRED: case AARCH64_OPND_SVE_SHRIMM_UNPRED_22: + num = (type == AARCH64_OPND_SVE_SHRIMM_UNPRED_22) ? 2 : 1; + size = aarch64_get_qualifier_esize (opnds[idx - num].qualifier); + if (!value_in_range_p (opnd->imm.value, 1, 8 * size)) { - unsigned int index = - (type == AARCH64_OPND_SVE_SHRIMM_UNPRED_22) ? 2 : 1; - size = aarch64_get_qualifier_esize (opnds[idx - index].qualifier); - if (!value_in_range_p (opnd->imm.value, 1, 8 * size)) - { - set_imm_out_of_range_error (mismatch_detail, idx, 1, 8*size); - return 0; - } - break; - } + set_imm_out_of_range_error (mismatch_detail, idx, 1, 8*size); + return 0; + } + break; default: break;