From nobody Wed Feb 11 02:33:39 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1695977935; cv=none; d=zohomail.com; s=zohoarc; b=TSuI0rsSx6oh96I+lMgJhlyJ3KtGkPJbOcDW/D6R+TsIhZAEgqe7GyL5TFUOYs2iy9LtZ3I3ubsa7PfwHKrskuGbJQIQurb095enNKBN2ykDi1fNmTOF1j7sAVgrd1yXSe2COkGjwpkSdKKnnoq+2Q4ifVO7fhk9XcBXGLAx9ac= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695977935; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Fo3sgQUoq1v/rXQDfdnS796xPwOPol/7CVX97Dogeq8=; b=MwGiEf86cMg2Ur/X62OHBNaTkv46Cp31/M0I0wRXQ7EiYi3S55G6FxPSiLaKc9K+D6BjE7fGXSTFwxZDwa/DoaIF/xal8ZopnA1wpNyn61vH0CDbd021mSdCzMP9dIqCAr8Qib9j992DjYBT/Nw51Lwl3fR0WWdIPjWK6kAmGKk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695977935557415.62894245121197; Fri, 29 Sep 2023 01:58:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9Dg-0005Ca-84; Fri, 29 Sep 2023 04:51:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DU-00051z-M4 for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qm9DA-0005bz-QJ for qemu-devel@nongnu.org; Fri, 29 Sep 2023 04:51:20 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-687-trWVRLUMOdCuyehyScSo0A-1; Fri, 29 Sep 2023 04:50:56 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id ABEC3811E7E; Fri, 29 Sep 2023 08:50:55 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6DDF810F1BE7; Fri, 29 Sep 2023 08:50:55 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 6F4FD21E6914; Fri, 29 Sep 2023 10:50:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695977460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Fo3sgQUoq1v/rXQDfdnS796xPwOPol/7CVX97Dogeq8=; b=TibOjdtLQUTBIiTTXeUOv4sI7jAwuvLNUuJlCg2byizpKYo5fBWwUGTfGDpA0dDzKszwDR p0dCh3YQ6wJWwTQa4+1CcJ7EBtauvYs1iLsBXyIq9l3BldqY2PXqkbdpbiJ/dej7Mfly78 xonO0MGdbuEvWIuOsGkP+JlCGjG3zr8= X-MC-Unique: trWVRLUMOdCuyehyScSo0A-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 11/56] target/mips: Clean up local variable shadowing Date: Fri, 29 Sep 2023 10:50:08 +0200 Message-ID: <20230929085053.2789105-12-armbru@redhat.com> In-Reply-To: <20230929085053.2789105-1-armbru@redhat.com> References: <20230929085053.2789105-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1695977935951100001 From: Philippe Mathieu-Daud=C3=A9 Fix: target/mips/tcg/nanomips_translate.c.inc:4410:33: error: declaration shad= ows a local variable [-Werror,-Wshadow] int32_t imm =3D extract32(ctx->opcode, 1, 13) | ^ target/mips/tcg/nanomips_translate.c.inc:3577:9: note: previous declarati= on is here int imm; ^ target/mips/tcg/translate.c:15578:19: error: declaration shadows a local = variable [-Werror,-Wshadow] for (unsigned i =3D 1; i < 32; i++) { ^ target/mips/tcg/translate.c:15567:9: note: previous declaration is here int i; ^ target/mips/tcg/msa_helper.c:7478:13: error: declaration shadows a local = variable [-Werror,-Wshadow] MSA_FLOAT_MAXOP(pwx->w[0], min, pws->w[0], pws->w[0], 32); ^ target/mips/tcg/msa_helper.c:7434:23: note: expanded from macro 'MSA_FLOA= T_MAXOP' float_status *status =3D &env->active_tc.msa_fp_status; ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20230904161235.84651-5-philmd@linaro.org> Signed-off-by: Markus Armbruster --- target/mips/tcg/msa_helper.c | 8 ++++---- target/mips/tcg/translate.c | 8 +++----- target/mips/tcg/nanomips_translate.c.inc | 6 +++--- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/target/mips/tcg/msa_helper.c b/target/mips/tcg/msa_helper.c index c314a74397..7a8dbada5d 100644 --- a/target/mips/tcg/msa_helper.c +++ b/target/mips/tcg/msa_helper.c @@ -7432,15 +7432,15 @@ void helper_msa_ftq_df(CPUMIPSState *env, uint32_t = df, uint32_t wd, =20 #define MSA_FLOAT_MAXOP(DEST, OP, ARG1, ARG2, BITS) = \ do { = \ - float_status *status =3D &env->active_tc.msa_fp_status; = \ + float_status *status_ =3D &env->active_tc.msa_fp_status; = \ int c; = \ = \ - set_float_exception_flags(0, status); = \ - DEST =3D float ## BITS ## _ ## OP(ARG1, ARG2, status); = \ + set_float_exception_flags(0, status_); = \ + DEST =3D float ## BITS ## _ ## OP(ARG1, ARG2, status_); = \ c =3D update_msacsr(env, 0, 0); = \ = \ if (get_enabled_exceptions(env, c)) { = \ - DEST =3D ((FLOAT_SNAN ## BITS(status) >> 6) << 6) | c; = \ + DEST =3D ((FLOAT_SNAN ## BITS(status_) >> 6) << 6) | c; = \ } = \ } while (0) =20 diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index 9bb40f1849..26d741d960 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -15564,10 +15564,8 @@ void gen_intermediate_code(CPUState *cs, Translati= onBlock *tb, int *max_insns, =20 void mips_tcg_init(void) { - int i; - cpu_gpr[0] =3D NULL; - for (i =3D 1; i < 32; i++) + for (unsigned i =3D 1; i < 32; i++) cpu_gpr[i] =3D tcg_global_mem_new(cpu_env, offsetof(CPUMIPSState, active_tc.gpr[i]), @@ -15584,7 +15582,7 @@ void mips_tcg_init(void) rname); } #endif /* !TARGET_MIPS64 */ - for (i =3D 0; i < 32; i++) { + for (unsigned i =3D 0; i < 32; i++) { int off =3D offsetof(CPUMIPSState, active_fpu.fpr[i].wr.d[0]); =20 fpu_f64[i] =3D tcg_global_mem_new_i64(cpu_env, off, fregnames[i]); @@ -15592,7 +15590,7 @@ void mips_tcg_init(void) msa_translate_init(); cpu_PC =3D tcg_global_mem_new(cpu_env, offsetof(CPUMIPSState, active_tc.PC), "PC"= ); - for (i =3D 0; i < MIPS_DSP_ACC; i++) { + for (unsigned i =3D 0; i < MIPS_DSP_ACC; i++) { cpu_HI[i] =3D tcg_global_mem_new(cpu_env, offsetof(CPUMIPSState, active_tc.HI= [i]), regnames_HI[i]); diff --git a/target/mips/tcg/nanomips_translate.c.inc b/target/mips/tcg/nan= omips_translate.c.inc index a98dde0d2e..d81a7c2d11 100644 --- a/target/mips/tcg/nanomips_translate.c.inc +++ b/target/mips/tcg/nanomips_translate.c.inc @@ -4407,8 +4407,8 @@ static int decode_nanomips_32_48_opc(CPUMIPSState *en= v, DisasContext *ctx) case NM_BPOSGE32C: check_dsp_r3(ctx); { - int32_t imm =3D extract32(ctx->opcode, 1, 13) | - extract32(ctx->opcode, 0, 1) << 13; + imm =3D extract32(ctx->opcode, 1, 13) + | extract32(ctx->opcode, 0, 1) << 13; =20 gen_compute_branch_nm(ctx, OPC_BPOSGE32, 4, -1, -2, imm << 1); @@ -4635,7 +4635,7 @@ static int decode_isa_nanomips(CPUMIPSState *env, Dis= asContext *ctx) break; case NM_LI16: { - int imm =3D extract32(ctx->opcode, 0, 7); + imm =3D extract32(ctx->opcode, 0, 7); imm =3D (imm =3D=3D 0x7f ? -1 : imm); if (rt !=3D 0) { tcg_gen_movi_tl(cpu_gpr[rt], imm); --=20 2.41.0