This is the mail archive of the 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]

Re: [Patch, ARM] Relax the restrictions on REG_SP under Thumb mode on ARMv8-A

On 11/07/17 10:14, Ramana Radhakrishnan wrote:
On Fri, May 26, 2017 at 2:34 PM, Jiong Wang <> wrote:

   For Thumb mode, since ARMv8-A, REG_SP is allowed in most of the places in
Rd/Rt/Rt2 etc while it was disallowed before ARMv8-A, and was rejected
the "reject_bad_reg" macro and several scattered checks.

   This patch only rejects REG_SP in "reject_bad_reg" and several related
for legacy architectures before ARMv8-A. I have checked those affected
, all of them qualify such relaxations.

   Testcases adjusted accordingly.
     * ld-sp-warn.d was written without .arch and without -march options
       By default it assumes all architectures, so I deleted the REG_SP
       on ldrsb as it's supported on ARMv8-A.  There are actually quite a few
       seperate tests on other architectures, for example ld-sp-warn-v7.l
       so there the test for ldrsb on legacy architectures are still covered.
     * sp-pc-validations-bad-t has been extended to armv8-a.
     * strex-bad-t.d restricted on armv7-a.
     * Some new tests for REG_SP used as Rd/Rt etc added in

   OK for master?

Since this affects release branches and I've got an internal user
complaining about this - can we backport this to the binutils 2.28 and
binutils 2.29 branches ?

It's in 2.29 already, and it applies cleanly on 2.28 branch and passed GAS
regression test.

This patch relaxes one restriction on REG_SP.  That restriction is valid
before ARMv8-A, but has been removed since ARMv8-A on ARM32.  GAS support
had missed this.  I think there is no risk to backport this bug fix.

I will wait Tristan's approval.



2017-05-25  Jiong Wang  <>

         * config/tc-arm.c (reject_bad_reg): Allow REG_SP on ARMv8-A.
         (parse_operands): Allow REG_SP for OP_oRRnpcsp and OP_RRnpcsp on
         (do_co_reg): Allow REG_SP for Rd on ARMv8-A.
         (do_t_add_sub): Likewise.
         (do_t_mov_cmp): Likewise.
         (do_t_tb): Likewise.
         * testsuite/gas/arm/ld-sp-warn.l: Delete the warning on REG_SP as Rt
         * testsuite/gas/arm/sp-pc-validations-bad-t-v8a.d: New test.
         * testsuite/gas/arm/sp-pc-validations-bad-t-v8a.l: New test.
         * testsuite/gas/arm/sp-pc-validations-bad-t.d: Specifies
         * testsuite/gas/arm/sp-pc-validations-bad-t.s: Remove ".arch
         * testsuite/gas/arm/sp-usage-thumb2-relax-on-v7.d: New test.
         * testsuite/gas/arm/sp-usage-thumb2-relax-on-v7.l: New test.
         * testsuite/gas/arm/sp-usage-thumb2-relax-on-v8.d: New test.
         * testsuite/gas/arm/sp-usage-thumb2-relax.s: New test.
         * testsuite/gas/arm/strex-bad-t.d: Specifies -march=armv7-a.

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