[NDS32] Restrict address mode, when symbol is TLS model.
authorChung-Ju Wu <jasonwucj@gmail.com>
Mon, 4 Feb 2019 07:31:45 +0000 (07:31 +0000)
committerChung-Ju Wu <jasonwucj@gcc.gnu.org>
Mon, 4 Feb 2019 07:31:45 +0000 (07:31 +0000)
gcc/
* config/nds32/nds32.c (nds32_legitimate_address_p): Add TLS model
into consideration.

From-SVN: r268509

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

index 1d57d7c..da8106b 100644 (file)
@@ -1,5 +1,10 @@
 2019-02-04  Chung-Ju Wu  <jasonwucj@gmail.com>
 
+       * config/nds32/nds32.c (nds32_legitimate_address_p): Add TLS model
+       into consideration.
+
+2019-02-04  Chung-Ju Wu  <jasonwucj@gmail.com>
+
        * config.gcc (with_nds32_lib, glibc):
        Remove TARGET_DEFAULT_TLSDESC_TRAMPOLINE=0 setting.
        * config/nds32/linux.h (TARGET_DEFAULT_TLSDESC_TRAMPOLINE): Delete.
index b4f4ede..6702b76 100644 (file)
@@ -2683,7 +2683,7 @@ nds32_legitimate_address_p (machine_mode mode, rtx x, bool strict)
              /* Now we see the [ + const_addr ] pattern, but we need
                 some further checking.  */
 
-             if (flag_pic)
+             if (flag_pic || SYMBOL_REF_TLS_MODEL (op0))
                return false;
 
              /* If -mcmodel=large, the 'const_addr' is not a valid address