sparc.c (RTX_OK_FOR_OFFSET_P): Fix off-by-one error.
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 4 Feb 2015 22:37:16 +0000 (22:37 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Wed, 4 Feb 2015 22:37:16 +0000 (22:37 +0000)
* 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
gcc/config/sparc/sparc.c

index 4a513fc601c42fdcd6b682b8d596b5f9696aa5a6..9554bcd0a6b1a04b4dc8f06875697cd5fdd580c6 100644 (file)
@@ -1,3 +1,8 @@
+2015-02-04  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * 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  <ebotcazou@adacore.com>
 
        * tree-ssa-loop-ivopts.c (get_address_cost): Use right mode for offset.
index 0cf2649ab97767d520df12dd2a9e8c489748bd53..3484809c1e3d8157b121f7382f3d91a4603ccd67 100644 (file)
@@ -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.