* reg-stack.c (replace_reg): Use IN_RANGE macro in gcc_assert().
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 26 Mar 2007 08:34:01 +0000 (08:34 +0000)
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 26 Mar 2007 08:34:01 +0000 (08:34 +0000)
        * config/i386/constraints.md
(define_constraint "I"): Use IN_RANGE macro.
(define_constraint "J"): Ditto.
(define_constraint "K"): Ditto.
(define_constraint "M"): Ditto.
(define_constraint "N"): Ditto.
(define_constraint "O"): Ditto.
* config/i386/predicates.md
(define_predicate "register_no_elim_operand"): Use IN_RANGE macro.
(define_predicate "const_0_to_3_operand"): Ditto.
(define_predicate "const_0_to_7_operand"): Ditto.
(define_predicate "const_0_to_15_operand"): Ditto.
(define_predicate "const_0_to_63_operand"): Ditto.
(define_predicate "const_0_to_255_operand"): Ditto.
(define_predicate "const_1_to_31_operand"): Ditto.
(define_predicate "const_2_to_3_operand"): Ditto.
(define_predicate "const_4_to_7_operand"): Ditto.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123210 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/constraints.md
gcc/config/i386/predicates.md
gcc/reg-stack.c

index 6f2c3dc..8adcaef 100644 (file)
@@ -1,3 +1,24 @@
+2007-03-26  Uros Bizjak  <ubizjak@gmail.com>
+
+       * reg-stack.c (replace_reg): Use IN_RANGE macro in gcc_assert().
+       * config/i386/constraints.md
+       (define_constraint "I"): Use IN_RANGE macro.
+       (define_constraint "J"): Ditto.
+       (define_constraint "K"): Ditto.
+       (define_constraint "M"): Ditto.
+       (define_constraint "N"): Ditto.
+       (define_constraint "O"): Ditto.
+       * config/i386/predicates.md
+       (define_predicate "register_no_elim_operand"): Use IN_RANGE macro.
+       (define_predicate "const_0_to_3_operand"): Ditto.
+       (define_predicate "const_0_to_7_operand"): Ditto.
+       (define_predicate "const_0_to_15_operand"): Ditto.
+       (define_predicate "const_0_to_63_operand"): Ditto.
+       (define_predicate "const_0_to_255_operand"): Ditto.
+       (define_predicate "const_1_to_31_operand"): Ditto.
+       (define_predicate "const_2_to_3_operand"): Ditto.
+       (define_predicate "const_4_to_7_operand"): Ditto.
+
 2007-03-25  David Edelsohn  <edelsohn@gnu.org>
 
        * config/rs6000/rs6000.c (rs6000_emit_prologue): Always clobber LR
index 8f3e3ce..da70021 100644 (file)
 (define_constraint "I"
   "Integer constant in the range 0 @dots{} 31, for 32-bit shifts."
   (and (match_code "const_int")
-       (match_test "ival >= 0 && ival <= 31")))
+       (match_test "IN_RANGE (ival, 0, 31)")))
 
 (define_constraint "J"
   "Integer constant in the range 0 @dots{} 63, for 64-bit shifts."
   (and (match_code "const_int")
-       (match_test "ival >= 0 && ival <= 63")))
+       (match_test "IN_RANGE (ival, 0, 63)")))
 
 (define_constraint "K"
   "Signed 8-bit integer constant."
   (and (match_code "const_int")
-       (match_test "ival >= -128 && ival <= 127")))
+       (match_test "IN_RANGE (ival, -128, 127)")))
 
 (define_constraint "L"
   "@code{0xFF} or @code{0xFFFF}, for andsi as a zero-extending move."
 (define_constraint "M"
   "0, 1, 2, or 3 (shifts for the @code{lea} instruction)."
   (and (match_code "const_int")
-       (match_test "ival >= 0 && ival <= 3")))
+       (match_test "IN_RANGE (ival, 0, 3)")))
 
 (define_constraint "N"
   "Unsigned 8-bit integer constant (for @code{in} and @code{out} 
    instructions)."
   (and (match_code "const_int")
-       (match_test "ival >= 0 && ival <= 255")))
+       (match_test "IN_RANGE (ival, 0, 255)")))
 
 (define_constraint "O"
   "@internal Integer constant in the range 0 @dots{} 127, for 128-bit shifts."
   (and (match_code "const_int")
-       (match_test "ival >= 0 && ival <= 127")))
+       (match_test "IN_RANGE (ival, 0, 127)")))
 
 ;; Floating-point constant constraints.
 ;; We allow constants even if TARGET_80387 isn't set, because the
index be2141c..86b6774 100644 (file)
     op = SUBREG_REG (op);
   return !(op == arg_pointer_rtx
           || op == frame_pointer_rtx
-          || (REGNO (op) >= FIRST_PSEUDO_REGISTER
-              && REGNO (op) <= LAST_VIRTUAL_REGISTER));
+          || IN_RANGE (REGNO (op),
+                       FIRST_PSEUDO_REGISTER, LAST_VIRTUAL_REGISTER));
 })
 
 ;; Similarly, but include the stack pointer.  This is used to prevent esp
 ;; Match 0 to 3.
 (define_predicate "const_0_to_3_operand"
   (and (match_code "const_int")
-       (match_test "INTVAL (op) >= 0 && INTVAL (op) <= 3")))
+       (match_test "IN_RANGE (INTVAL (op), 0, 3)")))
 
 ;; Match 0 to 7.
 (define_predicate "const_0_to_7_operand"
   (and (match_code "const_int")
-       (match_test "INTVAL (op) >= 0 && INTVAL (op) <= 7")))
+       (match_test "IN_RANGE (INTVAL (op), 0, 7)")))
 
 ;; Match 0 to 15.
 (define_predicate "const_0_to_15_operand"
   (and (match_code "const_int")
-       (match_test "INTVAL (op) >= 0 && INTVAL (op) <= 15")))
+       (match_test "IN_RANGE (INTVAL (op), 0, 15)")))
 
 ;; Match 0 to 63.
 (define_predicate "const_0_to_63_operand"
   (and (match_code "const_int")
-       (match_test "INTVAL (op) >= 0 && INTVAL (op) <= 63")))
+       (match_test "IN_RANGE (INTVAL (op), 0, 63)")))
 
 ;; Match 0 to 255.
 (define_predicate "const_0_to_255_operand"
   (and (match_code "const_int")
-       (match_test "INTVAL (op) >= 0 && INTVAL (op) <= 255")))
+       (match_test "IN_RANGE (INTVAL (op), 0, 255)")))
 
 ;; Match (0 to 255) * 8
 (define_predicate "const_0_to_255_mul_8_operand"
 ;; for shift & compare patterns, as shifting by 0 does not change flags).
 (define_predicate "const_1_to_31_operand"
   (and (match_code "const_int")
-       (match_test "INTVAL (op) >= 1 && INTVAL (op) <= 31")))
+       (match_test "IN_RANGE (INTVAL (op), 1, 31)")))
 
 ;; Match 2 or 3.
 (define_predicate "const_2_to_3_operand"
   (and (match_code "const_int")
-       (match_test "INTVAL (op) == 2 || INTVAL (op) == 3")))
+       (match_test "IN_RANGE (INTVAL (op), 2, 3)")))
 
 ;; Match 4 to 7.
 (define_predicate "const_4_to_7_operand"
   (and (match_code "const_int")
-       (match_test "INTVAL (op) >= 4 && INTVAL (op) <= 7")))
+       (match_test "IN_RANGE (INTVAL (op), 4, 7)")))
 
 ;; Match exactly one bit in 4-bit mask.
 (define_predicate "const_pow2_1_to_8_operand"
index 0cc3629..933bff2 100644 (file)
@@ -695,8 +695,7 @@ stack_result (tree decl)
 static void
 replace_reg (rtx *reg, int regno)
 {
-  gcc_assert (regno >= FIRST_STACK_REG);
-  gcc_assert (regno <= LAST_STACK_REG);
+  gcc_assert (IN_RANGE (regno, FIRST_STACK_REG, LAST_STACK_REG));
   gcc_assert (STACK_REG_P (*reg));
 
   gcc_assert (SCALAR_FLOAT_MODE_P (GET_MODE (*reg))