diff options
author | Jie Zhang <jie.zhang@analog.com> | 2010-08-25 05:25:09 +0000 |
---|---|---|
committer | Jie Zhang <jie.zhang@analog.com> | 2010-08-25 05:25:09 +0000 |
commit | 23a10334b22d9edadb33826da1d193121f2eda93 (patch) | |
tree | fd373763dbdf319aaf73adb4ca6ee9702bf694aa /gas/config/tc-arm.c | |
parent | 673bfd454bcb059022eb237ccae068c6a4446e49 (diff) | |
download | gdb-23a10334b22d9edadb33826da1d193121f2eda93.zip gdb-23a10334b22d9edadb33826da1d193121f2eda93.tar.gz gdb-23a10334b22d9edadb33826da1d193121f2eda93.tar.bz2 |
* config/tc-arm.c (encode_arm_addr_mode_2): Fix
BAD_PC_ADDRESSING condition.
testsuite/
* gas/arm/ldst-pc.d: New test.
* gas/arm/ldst-pc.s: New test.
* gas/arm/sp-pc-validations-bad.s: `str r0,[pc,#4]' is valid.
* gas/arm/sp-pc-validations-bad.l: Adjust accordingly.
Diffstat (limited to 'gas/config/tc-arm.c')
-rw-r--r-- | gas/config/tc-arm.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 6605e81..503249f 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -6819,11 +6819,18 @@ encode_arm_addr_mode_2 (int i, bfd_boolean is_t) if (is_pc && !inst.reloc.pc_rel) { const bfd_boolean is_load = ((inst.instruction & LOAD_BIT) != 0); - /* BAD_PC_ADDRESSING Condition = - is_load => is_t - which becomes !is_load || is_t. */ - constraint ((!is_load || is_t), + + /* If is_t is TRUE, it's called from do_ldstt. ldrt/strt + cannot use PC in addressing. + PC cannot be used in writeback addressing, either. */ + constraint ((is_t || inst.operands[i].writeback), BAD_PC_ADDRESSING); + + /* Use of PC in str is deprecated for ARMv7-A. */ + if (warn_on_deprecated + && !is_load + && ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_v7)) + as_warn (_("use of PC in this instruction is deprecated")); } if (inst.reloc.type == BFD_RELOC_UNUSED) |