aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/nds32
diff options
context:
space:
mode:
authorjasonwucj <jasonwucj@138bc75d-0d04-0410-961f-82ee72b054a4>2014-11-21 05:51:12 +0000
committerjasonwucj <jasonwucj@138bc75d-0d04-0410-961f-82ee72b054a4>2014-11-21 05:51:12 +0000
commitec2d68da4f4b40f3931366fd7492fffd30ab9cfe (patch)
tree9a69c55ce0e872baff2bd2872726e1c528cbb2e0 /gcc/config/nds32
parentaa51c13081f6dcc93a99d0395e3b4d342d088b4a (diff)
[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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217904 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/nds32')
-rw-r--r--gcc/config/nds32/nds32.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/config/nds32/nds32.c b/gcc/config/nds32/nds32.c
index 74ea4e6563f..5a8e24fc175 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;