OSDN Git Service

PR tree-optimization/18815
[pf3gnuchains/gcc-fork.git] / gcc / vec.h
index 43b7eab..945a413 100644 (file)
--- a/gcc/vec.h
+++ b/gcc/vec.h
@@ -29,7 +29,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
    out-of-line generic functions.  The vectors are designed to
    interoperate with the GTY machinery.
 
-   Because of the different behaviour of objects and of pointers to
+   Because of the different behavior of objects and of pointers to
    objects, there are two flavors.  One to deal with a vector of
    pointers to objects, and one to deal with a vector of objects
    themselves.  Both of these pass pointers to objects around -- in
@@ -200,7 +200,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
    Ensure that V has at least RESERVE slots available, if RESERVE is
    >= 0.  If RESERVE < 0, ensure that there is at least one spare
-   slot.  These differ in their reallocation behaviour, the first will
+   slot.  These differ in their reallocation behavior, the first will
    not create additional headroom, but the second mechanism will
    perform the usual exponential headroom increase.  Note this can
    cause V to be reallocated.  Returns nonzero iff reallocation
@@ -323,7 +323,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
    
    Find the first position in which VAL could be inserted without
    changing the ordering of V.  LESSTHAN is a function that returns
-   true if the first argument is strictly less than the second.   */
+   true if the first argument is strictly less than the second.  */
    
 #define VEC_lower_bound(TDEF,V,O,LT)    \
        (VEC_OP(TDEF,lower_bound)(V,O,LT VEC_CHECK_INFO))
@@ -452,13 +452,13 @@ static inline int VEC_OP (TDEF,space)                                       \
      (VEC (TDEF) *vec_, int alloc_)                                      \
 {                                                                        \
   return vec_ ? ((vec_)->alloc - (vec_)->num                             \
-                < (unsigned)(alloc_ < 0 ? 1 : alloc_)) : alloc_ != 0;    \
+                >= (unsigned)(alloc_ < 0 ? 1 : alloc_)) : !alloc_;       \
 }                                                                        \
                                                                          \
 static inline int VEC_OP (TDEF,reserve)                                          \
      (VEC (TDEF) **vec_, int alloc_ MEM_STAT_DECL)                       \
 {                                                                        \
-  int extend = VEC_OP (TDEF,space) (*vec_, alloc_);                      \
+  int extend = !VEC_OP (TDEF,space) (*vec_, alloc_);                     \
                                                                          \
   if (extend)                                                            \
     *vec_ = (VEC (TDEF) *) vec_##a##_p_reserve (*vec_, alloc_ PASS_MEM_STAT);   \
@@ -683,13 +683,13 @@ static inline int VEC_OP (TDEF,space)                                       \
      (VEC (TDEF) *vec_, int alloc_)                                      \
 {                                                                        \
   return vec_ ? ((vec_)->alloc - (vec_)->num                             \
-                < (unsigned)(alloc_ < 0 ? 1 : alloc_)) : alloc_ != 0;    \
+                >= (unsigned)(alloc_ < 0 ? 1 : alloc_)) : !alloc_;       \
 }                                                                        \
                                                                          \
 static inline int VEC_OP (TDEF,reserve)                                          \
      (VEC (TDEF) **vec_, int alloc_ MEM_STAT_DECL)                       \
 {                                                                        \
-  int extend = VEC_OP (TDEF,space) (*vec_, alloc_);                      \
+  int extend = !VEC_OP (TDEF,space) (*vec_, alloc_);                     \
                                                                          \
   if (extend)                                                            \
     *vec_ = (VEC (TDEF) *) vec_##a##_o_reserve (*vec_, alloc_,           \