From patchwork Fri Dec 22 01:23:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82714 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 407E43857739 for ; Fri, 22 Dec 2023 01:24:16 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 32FFA3858C74 for ; Fri, 22 Dec 2023 01:23:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 32FFA3858C74 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 32FFA3858C74 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.211.166.183 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703208239; cv=none; b=pNLbmZ8oKhaIH23sMrt5KkXxo43nr4RIHPnY7xc27pXdUqqHw5hVrEhHSVbEMOXp2jOlH6xkKQNezpA6r/1WiTjBOxvWiZ0JTDn13Tn5QD8kyOdDp1QNcvYLYpm8wOngepyEgG6O5T5XvwO3XnbS0DtXDi6M0KLXctwxvOuuNVE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703208239; c=relaxed/simple; bh=Sna9lzMlZ3jyOy3B2Vewl3HkZupDjUpXshYROWAwxx4=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=sNLLh42MAK5+lotDp9piYBGmkt0MvDycqgkzqY/wtJw5N5ffzd4I+Lfom+zjNUi7xgWoON9GfDMN/TZb5DrWZA1V3mU4+dyWuLFg0V1gREsMYa6DHXeI3jlEeSKfY4yBkwsudksB3Cc9J+lextk/CVCbU/FXyt6uZyJjGIr2gtc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id B4347340943; Fri, 22 Dec 2023 01:23:57 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH 01/15] sim: aarch64: fix -Wshadow=local warnings Date: Thu, 21 Dec 2023 20:23:41 -0500 Message-ID: <20231222012355.7504-1-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org These functions have local vars named "val" of type float, and then create nested vars named "val" of type double. This is a bit confusing and causes build time warnings. --- sim/aarch64/simulator.c | 42 ++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/sim/aarch64/simulator.c b/sim/aarch64/simulator.c index 8825819a3910..e7537b739aa0 100644 --- a/sim/aarch64/simulator.c +++ b/sim/aarch64/simulator.c @@ -7942,44 +7942,44 @@ do_FRINT (sim_cpu *cpu) TRACE_DECODE (cpu, "emulated at line %d", __LINE__); if (INSTR (22, 22)) { - double val = aarch64_get_FP_double (cpu, rs); + double dval = aarch64_get_FP_double (cpu, rs); switch (rmode) { case 0: /* mode N: nearest or even. */ { - double rval = round (val); + double rval = round (dval); - if (val - rval == 0.5) + if (dval - rval == 0.5) { if (((rval / 2.0) * 2.0) != rval) rval += 1.0; } - aarch64_set_FP_double (cpu, rd, round (val)); + aarch64_set_FP_double (cpu, rd, round (dval)); return; } case 1: /* mode P: towards +inf. */ - if (val < 0.0) - aarch64_set_FP_double (cpu, rd, trunc (val)); + if (dval < 0.0) + aarch64_set_FP_double (cpu, rd, trunc (dval)); else - aarch64_set_FP_double (cpu, rd, round (val)); + aarch64_set_FP_double (cpu, rd, round (dval)); return; case 2: /* mode M: towards -inf. */ - if (val < 0.0) - aarch64_set_FP_double (cpu, rd, round (val)); + if (dval < 0.0) + aarch64_set_FP_double (cpu, rd, round (dval)); else - aarch64_set_FP_double (cpu, rd, trunc (val)); + aarch64_set_FP_double (cpu, rd, trunc (dval)); return; case 3: /* mode Z: towards 0. */ - aarch64_set_FP_double (cpu, rd, trunc (val)); + aarch64_set_FP_double (cpu, rd, trunc (dval)); return; case 4: /* mode A: away from 0. */ - aarch64_set_FP_double (cpu, rd, round (val)); + aarch64_set_FP_double (cpu, rd, round (dval)); return; case 6: /* mode X: use FPCR with exactness check. */ @@ -9186,29 +9186,29 @@ do_scalar_FCM (sim_cpu *cpu) TRACE_DECODE (cpu, "emulated at line %d", __LINE__); if (INSTR (22, 22)) { - double val1 = aarch64_get_FP_double (cpu, rn); - double val2 = aarch64_get_FP_double (cpu, rm); + double dval1 = aarch64_get_FP_double (cpu, rn); + double dval2 = aarch64_get_FP_double (cpu, rm); switch (EUac) { case 0: /* 000 */ - result = val1 == val2; + result = dval1 == dval2; break; case 3: /* 011 */ - val1 = fabs (val1); - val2 = fabs (val2); + dval1 = fabs (dval1); + dval2 = fabs (dval2); ATTRIBUTE_FALLTHROUGH; case 2: /* 010 */ - result = val1 >= val2; + result = dval1 >= dval2; break; case 7: /* 111 */ - val1 = fabs (val1); - val2 = fabs (val2); + dval1 = fabs (dval1); + dval2 = fabs (dval2); ATTRIBUTE_FALLTHROUGH; case 6: /* 110 */ - result = val1 > val2; + result = dval1 > dval2; break; default: