From: Tom Tromey via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [PATCH] Remove dead code from scalar_binop
Date: Wed, 1 Mar 2023 14:27:08 -0700 [thread overview]
Message-ID: <20230301212708.4030388-1-tromey@adacore.com> (raw)
scalar_binop has code for "&&" and "||", but I think this code can't
currently be run -- and, furthermore, it doesn't make sense to have
this code here, as the point of these operators is to short-circuit
evaluation.
This patch removes the dead code.
Regression tested on x86-64 Fedora 36.
---
gdb/valarith.c | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/gdb/valarith.c b/gdb/valarith.c
index 6ea0cd9e8d1..ad53febcedc 100644
--- a/gdb/valarith.c
+++ b/gdb/valarith.c
@@ -1331,14 +1331,6 @@ scalar_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
v = v1 ^ v2;
break;
- case BINOP_LOGICAL_AND:
- v = v1 && v2;
- break;
-
- case BINOP_LOGICAL_OR:
- v = v1 || v2;
- break;
-
case BINOP_MIN:
v = v1 < v2 ? v1 : v2;
break;
@@ -1492,14 +1484,6 @@ scalar_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
v = v1 ^ v2;
break;
- case BINOP_LOGICAL_AND:
- v = v1 && v2;
- break;
-
- case BINOP_LOGICAL_OR:
- v = v1 || v2;
- break;
-
case BINOP_MIN:
v = v1 < v2 ? v1 : v2;
break;
--
2.39.1
next reply other threads:[~2023-03-01 21:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-01 21:27 Tom Tromey via Gdb-patches [this message]
2023-03-10 23:38 ` Kevin Buettner via Gdb-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230301212708.4030388-1-tromey@adacore.com \
--to=gdb-patches@sourceware.org \
--cc=tromey@adacore.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox