aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-01-12 20:16:22 +1030
committerAlan Modra <amodra@gmail.com>2020-01-13 12:12:05 +1030
commit5496abe1c5c31aa6648e8fdb15e4122025bcabfe (patch)
tree5e682ab1be6b87f94493f7fa4a4506d45f2f8362 /opcodes/tic4x-dis.c
parentubsan: fr30: left shift of negative value (diff)
downloadbinutils-gdb-5496abe1c5c31aa6648e8fdb15e4122025bcabfe.tar.gz
binutils-gdb-5496abe1c5c31aa6648e8fdb15e4122025bcabfe.tar.bz2
binutils-gdb-5496abe1c5c31aa6648e8fdb15e4122025bcabfe.zip
tic4x: sign extension using shifts
Don't do that. Especially don't use shift counts that assume the type being shifted is 32 bits when the type is long/unsigned long. Also reverts part of a change I made on 2019-12-11 to tic4x_print_register that on closer inspection turns out to be unnecessary. include/ * opcode/tic4x.h (EXTR): Delete. (EXTRU, EXTRS, INSERTU, INSERTS): Rewrite without zero/sign extension using shifts. Do trim INSERTU value to specified bitfield. opcodes/ * tic4x-dis.c (tic4x_print_register): Remove dead code. gas/ * config/tc-tic4x.c (tic4x_operands_match): Correct tic3x trap insertion.
Diffstat (limited to 'opcodes/tic4x-dis.c')
-rw-r--r--opcodes/tic4x-dis.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/opcodes/tic4x-dis.c b/opcodes/tic4x-dis.c
index 1d7946918b7..34e270b7138 100644
--- a/opcodes/tic4x-dis.c
+++ b/opcodes/tic4x-dis.c
@@ -148,8 +148,7 @@ tic4x_print_register (struct disassemble_info *info, unsigned long regno)
= (tic4x_register_t *)(tic4x_registers + i);
}
}
- if (regno > (IS_CPU_TIC4X (tic4x_version) ? TIC4X_REG_MAX : TIC3X_REG_MAX)
- || registertable[regno] == NULL)
+ if (regno > (IS_CPU_TIC4X (tic4x_version) ? TIC4X_REG_MAX : TIC3X_REG_MAX))
return 0;
if (info != NULL)
(*info->fprintf_func) (info->stream, "%s", registertable[regno]->name);