aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorMatthew Gretton-Dann <matthew.gretton-dann@arm.com>2010-07-01 10:02:46 +0000
committerMatthew Gretton-Dann <matthew.gretton-dann@arm.com>2010-07-01 10:02:46 +0000
commit76fa04a48e54c68fa6f16db02634b86ff340b98e (patch)
treec8e86d7a21cbaed719d8a17700ddab1de275ac3f /gas
parent726d3ab069e07a312b87d892e596464e463c2744 (diff)
downloadgdb-76fa04a48e54c68fa6f16db02634b86ff340b98e.zip
gdb-76fa04a48e54c68fa6f16db02634b86ff340b98e.tar.gz
gdb-76fa04a48e54c68fa6f16db02634b86ff340b98e.tar.bz2
* gas/config/tc-arm.c (do_t_mov_cmp): Fix reporting of unpredictable and
deprecated mov register instructions. * gas/testsuite/gas/arm/thumb2_bad_reg.s: Update mov register tests. * gas/testsuite/gas/arm/thumb2_bad_reg.l: Likewise.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-arm.c21
-rw-r--r--gas/testsuite/ChangeLog5
-rw-r--r--gas/testsuite/gas/arm/thumb2_bad_reg.l12
-rw-r--r--gas/testsuite/gas/arm/thumb2_bad_reg.s12
5 files changed, 49 insertions, 6 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 854f350..887d7ce 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-01 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
+
+ * config/tc-arm.c (do_t_mov_cmp): Fix reporting of unpredictable and
+ deprecated mov register instructions.
+
2010-07-01 Alan Modra <amodra@gmail.com>
* config/tc-ppc.c (toc_reloc_types): New variable.
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 8137868..67b36d5 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -10273,9 +10273,24 @@ do_t_mov_cmp (void)
reject_bad_reg (Rn);
reject_bad_reg (Rm);
}
- else if ((Rn == REG_SP || Rn == REG_PC)
- && (Rm == REG_SP || Rm == REG_PC))
- reject_bad_reg (Rm);
+ else if (narrow)
+ {
+ /* This is mov.n. */
+ if ((Rn == REG_SP || Rn == REG_PC)
+ && (Rm == REG_SP || Rm == REG_PC))
+ {
+ as_warn (_("Use of r%u as a source register is "
+ "deprecated when r%u is the destination "
+ "register."), Rm, Rn);
+ }
+ }
+ else
+ {
+ /* This is mov.w. */
+ constraint (Rn == REG_PC, BAD_PC);
+ constraint (Rm == REG_PC, BAD_PC);
+ constraint (Rn == REG_SP && Rm == REG_SP, BAD_SP);
+ }
}
else
reject_bad_reg (Rn);
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index fcfd285..0fb9b72 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-01 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
+
+ * gas/arm/thumb2_bad_reg.s: Update mov register tests.
+ * gas/arm/thumb2_bad_reg.l: Likewise.
+
2010-06-29 Alan Modra <amodra@gmail.com>
* gas/maxq10/maxq10.exp: Delete file.
diff --git a/gas/testsuite/gas/arm/thumb2_bad_reg.l b/gas/testsuite/gas/arm/thumb2_bad_reg.l
index 1da7bac..2679e59 100644
--- a/gas/testsuite/gas/arm/thumb2_bad_reg.l
+++ b/gas/testsuite/gas/arm/thumb2_bad_reg.l
@@ -137,14 +137,24 @@
[^:]*:[0-9]+: Error: r15 not allowed here -- `mls r0,r0,r0,r15'
[^:]*:[0-9]+: Error: r13 not allowed here -- `mov.w r13,#1'
[^:]*:[0-9]+: Error: r15 not allowed here -- `mov.w r15,#1'
+[^:]*:[0-9]+: Error: r15 not allowed here -- `mov.w r0,r15'
+[^:]*:[0-9]+: Error: r15 not allowed here -- `mov.w r15,r0'
[^:]*:[0-9]+: Error: r13 not allowed here -- `movs.w r0,r13'
[^:]*:[0-9]+: Error: r15 not allowed here -- `movs.w r0,r15'
[^:]*:[0-9]+: Error: r13 not allowed here -- `movs.w r13,r0'
[^:]*:[0-9]+: Error: r15 not allowed here -- `movs.w r15,r0'
[^:]*:[0-9]+: Error: r13 not allowed here -- `mov.w r13,r13'
-[^:]*:[0-9]+: Error: r13 not allowed here -- `mov.w r15,r13'
+[^:]*:[0-9]+: Error: r15 not allowed here -- `mov.w r15,r13'
[^:]*:[0-9]+: Error: r15 not allowed here -- `mov.w r13,r15'
[^:]*:[0-9]+: Error: r15 not allowed here -- `mov.w r15,r15'
+[^:]*:[0-9]+: Warning: Use of r13 as a source register is deprecated when r13 is the destination register.
+[^:]*:[0-9]+: Warning: Use of r13 as a source register is deprecated when r15 is the destination register.
+[^:]*:[0-9]+: Warning: Use of r15 as a source register is deprecated when r13 is the destination register.
+[^:]*:[0-9]+: Warning: Use of r15 as a source register is deprecated when r15 is the destination register.
+[^:]*:[0-9]+: Error: r13 not allowed here -- `movs r13,r13'
+[^:]*:[0-9]+: Error: r15 not allowed here -- `movs r15,r13'
+[^:]*:[0-9]+: Error: r13 not allowed here -- `movs r13,r15'
+[^:]*:[0-9]+: Error: r15 not allowed here -- `movs r15,r15'
[^:]*:[0-9]+: Error: r13 not allowed here -- `movt r13,#1'
[^:]*:[0-9]+: Error: r15 not allowed here -- `movt r15,#1'
[^:]*:[0-9]+: Error: r13 not allowed here -- `mrc p0,#1,r13,cr0,cr0'
diff --git a/gas/testsuite/gas/arm/thumb2_bad_reg.s b/gas/testsuite/gas/arm/thumb2_bad_reg.s
index 20a26e0..f1b1c0b 100644
--- a/gas/testsuite/gas/arm/thumb2_bad_reg.s
+++ b/gas/testsuite/gas/arm/thumb2_bad_reg.s
@@ -191,8 +191,8 @@ test:
mov r13, r0 @ OK
mov r15, r0 @ OK
mov.w r0, r13 @ OK
- mov.w r0, r15 @ OK
- mov.w r15, r0 @ OK
+ mov.w r0, r15
+ mov.w r15, r0
mov.w r13, r0 @ OK
movs.w r0, r13
movs.w r0, r15
@@ -202,6 +202,14 @@ test:
mov.w r15, r13
mov.w r13, r15
mov.w r15, r15
+ mov r13, r13 @ Deprecated
+ mov r15, r13 @ Deprecated
+ mov r13, r15 @ Deprecated
+ mov r15, r15 @ Deprecated
+ movs r13, r13
+ movs r15, r13
+ movs r13, r15
+ movs r15, r15
@ MOVT
movt r13, #1
movt r15, #1