[NDS32] New option -minline-asm-r15.
authorChung-Ju Wu <jasonwucj@gmail.com>
Sat, 19 May 2018 15:10:08 +0000 (15:10 +0000)
committerChung-Ju Wu <jasonwucj@gcc.gnu.org>
Sat, 19 May 2018 15:10:08 +0000 (15:10 +0000)
gcc/
* config/nds32/nds32.c
(nds32_md_asm_adjust): Consider flag_inline_asm_r15 variable.
* config/nds32/nds32.opt (minline-asm-r15): New option.

From-SVN: r260400

gcc/ChangeLog
gcc/config/nds32/nds32.c
gcc/config/nds32/nds32.opt

index fb259255a16d82d6392c98e91400b1ec2d6b0bea..97aa4e782f2d659beb9dd2309370cb2cc6256690 100644 (file)
@@ -1,3 +1,9 @@
+2018-05-19  Chung-Ju Wu  <jasonwucj@gmail.com>
+
+       * config/nds32/nds32.c
+       (nds32_md_asm_adjust): Consider flag_inline_asm_r15 variable.
+       * config/nds32/nds32.opt (minline-asm-r15): New option.
+
 2018-05-19  Chung-Ju Wu  <jasonwucj@gmail.com>
 
        * common/config/nds32/nds32-common.c (TARGET_DEFAULT_TARGET_FLAGS): Add
index b705ae6a77aac8b24fec62174a66ebd9faf1a973..632a54477c31d896c4db005d2fcf01fa5b5bdcc3 100644 (file)
@@ -4066,8 +4066,11 @@ nds32_md_asm_adjust (vec<rtx> &outputs ATTRIBUTE_UNUSED,
                     vec<const char *> &constraints ATTRIBUTE_UNUSED,
                     vec<rtx> &clobbers, HARD_REG_SET &clobbered_regs)
 {
-  clobbers.safe_push (gen_rtx_REG (SImode, TA_REGNUM));
-  SET_HARD_REG_BIT (clobbered_regs, TA_REGNUM);
+  if (!flag_inline_asm_r15)
+    {
+      clobbers.safe_push (gen_rtx_REG (SImode, TA_REGNUM));
+      SET_HARD_REG_BIT (clobbered_regs, TA_REGNUM);
+    }
   return NULL;
 }
 
index 9e481549d9dbb0d34bbecae6e9ab9699de7e2f8c..a9cd72c422b8dfcd944895718c29fe19011e41e6 100644 (file)
@@ -446,3 +446,7 @@ Always save $lp in the stack.
 munaligned-access
 Target Report Var(flag_unaligned_access) Init(0)
 Enable unaligned word and halfword accesses to packed data.
+
+minline-asm-r15
+Target Report Var(flag_inline_asm_r15) Init(0)
+Allow use r15 for inline ASM.