aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2017-12-18 09:37:57 +0000
committerNick Clifton <nickc@redhat.com>2017-12-18 09:37:57 +0000
commit4f588891ac7d4653e1bd861ca38c2a4e6d5e907c (patch)
treef37a43a04dfa2b20388ce554499466c17c70c725 /gas
parent10c17abdd052c5f8f9c2bcdf8b01dffe5d06baf0 (diff)
downloadgdb-4f588891ac7d4653e1bd861ca38c2a4e6d5e907c.zip
gdb-4f588891ac7d4653e1bd861ca38c2a4e6d5e907c.tar.gz
gdb-4f588891ac7d4653e1bd861ca38c2a4e6d5e907c.tar.bz2
Resolve PR 22493 - the encoding to be used when pushing the stack pointer onto the stack.
PR 22493 * config/tc-arm.c (encode_ldmstm): Do not use A2 encoding of the PUSH insn when pushing the stack pointer.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-arm.c5
2 files changed, 11 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index d495548..ed794be 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2017-12-18 Nick Clifton <nickc@redhat.com>
+
+ PR 22493
+ * config/tc-arm.c (encode_ldmstm): Do not use A2 encoding of the
+ PUSH insn when pushing the stack pointer.
+
2017-12-18 Jan Beulich <jbeulich@suse.com>
* config/tc-i386.c (regymm, regzmm): Delete.
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 080e4da..c12a453 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -8908,6 +8908,11 @@ encode_ldmstm(int from_push_pop_mnem)
{
int is_push = (inst.instruction & A_PUSH_POP_OP_MASK) == A1_OPCODE_PUSH;
+ if (is_push && one_reg == 13 /* SP */)
+ /* PR 22483: The A2 encoding cannot be used when
+ pushing the stack pointer as this is UNPREDICTABLE. */
+ return;
+
inst.instruction &= A_COND_MASK;
inst.instruction |= is_push ? A2_OPCODE_PUSH : A2_OPCODE_POP;
inst.instruction |= one_reg << 12;