From a6bc87d334fa5eed69acda9813cbf369dcdf9cf2 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Wed, 4 Feb 2015 22:37:16 +0000 Subject: [PATCH] sparc.c (RTX_OK_FOR_OFFSET_P): Fix off-by-one error. * config/sparc/sparc.c (RTX_OK_FOR_OFFSET_P): Fix off-by-one error. (RTX_OK_FOR_OLO10_P): Likewise. From-SVN: r220421 --- gcc/ChangeLog | 5 +++++ gcc/config/sparc/sparc.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4a513fc601c..9554bcd0a6b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-02-04 Eric Botcazou + + * config/sparc/sparc.c (RTX_OK_FOR_OFFSET_P): Fix off-by-one error. + (RTX_OK_FOR_OLO10_P): Likewise. + 2015-02-04 Eric Botcazou * tree-ssa-loop-ivopts.c (get_address_cost): Use right mode for offset. diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 0cf2649ab97..3484809c1e3 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -3925,12 +3925,12 @@ legitimate_pic_operand_p (rtx x) #define RTX_OK_FOR_OFFSET_P(X, MODE) \ (CONST_INT_P (X) \ && INTVAL (X) >= -0x1000 \ - && INTVAL (X) < (0x1000 - GET_MODE_SIZE (MODE))) + && INTVAL (X) <= (0x1000 - GET_MODE_SIZE (MODE))) #define RTX_OK_FOR_OLO10_P(X, MODE) \ (CONST_INT_P (X) \ && INTVAL (X) >= -0x1000 \ - && INTVAL (X) < (0xc00 - GET_MODE_SIZE (MODE))) + && INTVAL (X) <= (0xc00 - GET_MODE_SIZE (MODE))) /* Handle the TARGET_LEGITIMATE_ADDRESS_P target hook. -- 2.30.2