summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2018-08-21 10:47:47 -0400
committerSimon Marchi <simon.marchi@ericsson.com>2018-08-21 10:47:47 -0400
commita4497d2f8486502ab5140ec5168d5f13ec375155 (patch)
tree392e73ab89566e9874d6f7ecd3d2bf216e8552c9
parent06d743b72334ad4f9297c206290a47c261aa8e5f (diff)
downloadbinutils-gdb-a4497d2f8486502ab5140ec5168d5f13ec375155.tar.gz
Remove unnecessary ternary operator in m32c-tdep.c
Bug 17816 pointed out a useless use of the ternary operator: case 0x0: sd.reg = (size == 1 ? &st->r0 : &st->r0); break; I believe that this is right. If size is 1, the instruction refers to part of r0, while if size is 2, the instruction refers to the whole of r0. gdb/ChangeLog: PR gdb/17816 * m32c-tdep.c (m32c_decode_srcdest4): Remove unnecessary ternary operator.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/m32c-tdep.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ff4d1cb5483..9173bf94611 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2018-08-21 Simon Marchi <simon.marchi@ericsson.com>
+
+ PR gdb/17816
+ * m32c-tdep.c (m32c_decode_srcdest4): Remove unnecessary ternary
+ operator.
+
2018-08-19 Simon Marchi <simon.marchi@polymtl.ca>
* solib-svr4.c (svr4_exec_displacement): Fix formatting.
diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c
index fc6277ef5c1..6fa24452da9 100644
--- a/gdb/m32c-tdep.c
+++ b/gdb/m32c-tdep.c
@@ -1236,7 +1236,7 @@ m32c_decode_srcdest4 (struct m32c_pv_state *st,
switch (code)
{
- case 0x0: sd.reg = (size == 1 ? &st->r0 : &st->r0); break;
+ case 0x0: sd.reg = &st->r0; break;
case 0x1: sd.reg = (size == 1 ? &st->r0 : &st->r1); break;
case 0x2: sd.reg = (size == 1 ? &st->r1 : &st->r2); break;
case 0x3: sd.reg = (size == 1 ? &st->r1 : &st->r3); break;