This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, ARM] Fix error handling for pc-relative VSTR in Thumb mode.


gas/ChangeLog:

2013-03-06  Will Newton  <will.newton@linaro.org>

	* config/tc-arm.c (do_neon_ldr_str): Fix error check for PC register
	in VSTR in Thumb mode.

gas/testsuite/ChangeLog:

2013-03-06  Will Newton  <will.newton@linaro.org>

	* gas/arm/neon-addressing-bad.l: Add tests VSTR with PC register in
	Thumb mode.
	* gas/arm/neon-addressing-bad.s: Likewise.
---
 gas/config/tc-arm.c                         | 2 +-
 gas/testsuite/gas/arm/neon-addressing-bad.l | 2 ++
 gas/testsuite/gas/arm/neon-addressing-bad.s | 2 ++
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 51ab230..5a12b07 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -15687,7 +15687,7 @@ do_neon_ldr_str (void)
      And is UNPREDICTABLE in thumb mode.  */
   if (!is_ldr
       && inst.operands[1].reg == REG_PC
-      && ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_v7))
+      && (ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_v7) || thumb_mode))
     {
       if (!thumb_mode && warn_on_deprecated)
 	as_warn (_("Use of PC here is deprecated"));
diff --git a/gas/testsuite/gas/arm/neon-addressing-bad.l b/gas/testsuite/gas/arm/neon-addressing-bad.l
index 360a891..7918a5c 100644
--- a/gas/testsuite/gas/arm/neon-addressing-bad.l
+++ b/gas/testsuite/gas/arm/neon-addressing-bad.l
@@ -17,3 +17,5 @@
 [^:]*:21: Error: r15 not allowed here -- `vst1.8 {Q1},R0'
 [^:]*:22: Error: r15 not allowed here -- `vst1.8 {D0},\[PC\]'
 [^:]*:23: Error: r15 not allowed here -- `vst1.8 {D0},\[PC,#0\]'
+[^:]*:24: Error: Use of PC here is UNPREDICTABLE -- `vstr D0,\[PC\]'
+[^:]*:25: Error: Use of PC here is UNPREDICTABLE -- `vstr D0,\[PC,#0\]'
diff --git a/gas/testsuite/gas/arm/neon-addressing-bad.s b/gas/testsuite/gas/arm/neon-addressing-bad.s
index c134ead..773ec43 100644
--- a/gas/testsuite/gas/arm/neon-addressing-bad.s
+++ b/gas/testsuite/gas/arm/neon-addressing-bad.s
@@ -21,3 +21,5 @@ VST1.8 {D0}, R0
 VST1.8 {Q1}, R0
 VST1.8 {D0}, [PC]
 VST1.8 {D0}, [PC, #0]
+VSTR D0, [PC]
+VSTR D0, [PC, #0]
-- 
1.8.1.2

gas/ChangeLog:

2013-03-06  Will Newton  <will.newton@linaro.org>

	* config/tc-arm.c (do_neon_ldr_str): Fix error check for PC register
	in VSTR in Thumb mode.

gas/testsuite/ChangeLog:

2013-03-06  Will Newton  <will.newton@linaro.org>

	* gas/arm/neon-addressing-bad.l: Add tests VSTR with PC register in
	Thumb mode.
	* gas/arm/neon-addressing-bad.s: Likewise.
---
 gas/config/tc-arm.c                         | 2 +-
 gas/testsuite/gas/arm/neon-addressing-bad.l | 2 ++
 gas/testsuite/gas/arm/neon-addressing-bad.s | 2 ++
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 51ab230..5a12b07 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -15687,7 +15687,7 @@ do_neon_ldr_str (void)
      And is UNPREDICTABLE in thumb mode.  */
   if (!is_ldr
       && inst.operands[1].reg == REG_PC
-      && ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_v7))
+      && (ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_v7) || thumb_mode))
     {
       if (!thumb_mode && warn_on_deprecated)
 	as_warn (_("Use of PC here is deprecated"));
diff --git a/gas/testsuite/gas/arm/neon-addressing-bad.l b/gas/testsuite/gas/arm/neon-addressing-bad.l
index 360a891..7918a5c 100644
--- a/gas/testsuite/gas/arm/neon-addressing-bad.l
+++ b/gas/testsuite/gas/arm/neon-addressing-bad.l
@@ -17,3 +17,5 @@
 [^:]*:21: Error: r15 not allowed here -- `vst1.8 {Q1},R0'
 [^:]*:22: Error: r15 not allowed here -- `vst1.8 {D0},\[PC\]'
 [^:]*:23: Error: r15 not allowed here -- `vst1.8 {D0},\[PC,#0\]'
+[^:]*:24: Error: Use of PC here is UNPREDICTABLE -- `vstr D0,\[PC\]'
+[^:]*:25: Error: Use of PC here is UNPREDICTABLE -- `vstr D0,\[PC,#0\]'
diff --git a/gas/testsuite/gas/arm/neon-addressing-bad.s b/gas/testsuite/gas/arm/neon-addressing-bad.s
index c134ead..773ec43 100644
--- a/gas/testsuite/gas/arm/neon-addressing-bad.s
+++ b/gas/testsuite/gas/arm/neon-addressing-bad.s
@@ -21,3 +21,5 @@ VST1.8 {D0}, R0
 VST1.8 {Q1}, R0
 VST1.8 {D0}, [PC]
 VST1.8 {D0}, [PC, #0]
+VSTR D0, [PC]
+VSTR D0, [PC, #0]
-- 
1.8.1.2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]