aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorChung-Ju Wu <jasonwucj@gmail.com>2014-11-21 05:51:12 +0000
committerChung-Ju Wu <jasonwucj@gcc.gnu.org>2014-11-21 05:51:12 +0000
commit344250256199f46aba4be2d35f966cb557d70344 (patch)
tree9a69c55ce0e872baff2bd2872726e1c528cbb2e0 /gcc
parent47e0e7d28f313ec36e2372dd9e52056581c8014d (diff)
downloadgcc-344250256199f46aba4be2d35f966cb557d70344.zip
gcc-344250256199f46aba4be2d35f966cb557d70344.tar.gz
gcc-344250256199f46aba4be2d35f966cb557d70344.tar.bz2
[NDS32] Look into LO_SUM's operand to determine whether it is a valid address.
gcc/ * config/nds32/nds32.c (nds32_legitimate_address_p): For LO_SUM, we need to look into its operand to determine whether it is a valid address. From-SVN: r217904
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/nds32/nds32.c10
2 files changed, 14 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 09d1a26..8cfdd62 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2014-11-21 Chung-Ju Wu <jasonwucj@gmail.com>
+ * config/nds32/nds32.c (nds32_legitimate_address_p): For LO_SUM,
+ we need to look into its operand to determine if it is a valid
+ address.
+
+2014-11-21 Chung-Ju Wu <jasonwucj@gmail.com>
+
* config/nds32/nds32.c (nds32_emit_stack_push_multiple): Add new
vaarg_p argument and create correct CFI info.
(nds32_expand_prologue): Pass true or false to
diff --git a/gcc/config/nds32/nds32.c b/gcc/config/nds32/nds32.c
index 74ea4e6..5a8e24f 100644
--- a/gcc/config/nds32/nds32.c
+++ b/gcc/config/nds32/nds32.c
@@ -2041,8 +2041,14 @@ nds32_legitimate_address_p (machine_mode mode, rtx x, bool strict)
return false;
case LO_SUM:
- if (!TARGET_GP_DIRECT)
- return true;
+ /* (mem (lo_sum (reg) (symbol_ref))) */
+ /* (mem (lo_sum (reg) (const))) */
+ gcc_assert (REG_P (XEXP (x, 0)));
+ if (GET_CODE (XEXP (x, 1)) == SYMBOL_REF
+ || GET_CODE (XEXP (x, 1)) == CONST)
+ return nds32_legitimate_address_p (mode, XEXP (x, 1), strict);
+ else
+ return false;
default:
return false;