diff options
Diffstat (limited to 'gcc/config/ft32/ft32.c')
-rw-r--r-- | gcc/config/ft32/ft32.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/config/ft32/ft32.c b/gcc/config/ft32/ft32.c index 0386e068f3b..d7d41a2f3ca 100644 --- a/gcc/config/ft32/ft32.c +++ b/gcc/config/ft32/ft32.c @@ -866,6 +866,8 @@ static bool ft32_addr_space_legitimate_address_p (machine_mode mode, rtx x, bool strict, addr_space_t as ATTRIBUTE_UNUSED) { + int max_offset = TARGET_FT32B ? 16384 : 128; + if (mode != BLKmode) { if (GET_CODE (x) == PLUS) @@ -875,8 +877,9 @@ ft32_addr_space_legitimate_address_p (machine_mode mode, rtx x, bool strict, op2 = XEXP (x, 1); if (GET_CODE (op1) == REG && CONST_INT_P (op2) - && INTVAL (op2) >= -128 - && INTVAL (op2) < 128 && reg_ok_for_base_p (op1, strict)) + && (-max_offset <= INTVAL (op2)) + && (INTVAL (op2) < max_offset) + && reg_ok_for_base_p (op1, strict)) goto yes; if (GET_CODE (op1) == SYMBOL_REF && CONST_INT_P (op2)) goto yes; |