From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10197 invoked by alias); 20 Apr 2012 01:58:56 -0000 Received: (qmail 7175 invoked by uid 9176); 20 Apr 2012 01:58:18 -0000 Date: Fri, 20 Apr 2012 02:07:00 -0000 From: GDB Administrator To: gdb-patches@sourceware.org Subject: New ARI warning Fri Apr 20 01:58:17 UTC 2012 Message-ID: <20120420015817.GA7169@sourceware.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Mutt/1.4.2.1i Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-04/txt/msg00653.txt.bz2 140a141,148 > gdb/common/vec.c:39: code: inline: Do not use the inline attribute; since= the compiler generally ignores this, better algorithm selection is needed = to improved performance gdb/common/vec.c:39:static inline unsigned > gdb/common/vec.h:419: code: inline: Do not use the inline attribute; sinc= e the compiler generally ignores this, better algorithm selection is needed= to improved performance gdb/common/vec.h:419:#define DEF_VEC_I(T) static inline void VEC_OP= (T,must_be_integral_type) (void) { (void)~(T)0; } = VEC_T(T); DEF_VEC_FUNC_P(T) DEF_VEC_A= LLOC_FUNC_I(T) struct vec_swallow_trailing_semi > gdb/common/vec.h:431: code: inline: Do not use the inline attribute; sinc= e the compiler generally ignores this, better algorithm selection is needed= to improved performance gdb/common/vec.h:431:#define DEF_VEC_P(T) static inline void VEC_OP= (T,must_be_pointer_type) (void) { (void)((T)1 =3D=3D (void = *)1); } VEC_T(T); DEF_VEC_FUNC_P(T) = DEF_VEC_ALLOC_FUNC_P(T) struct vec_swallow_trailing_semi > gdb/common/vec.h:520: code: inline: Do not use the inline attribute; sinc= e the compiler generally ignores this, better algorithm selection is needed= to improved performance gdb/common/vec.h:520:#define DEF_VEC_ALLOC_FUNC_I(T) static inline V= EC(T) *VEC_OP (T,alloc) (int alloc_) { = return (VEC(T) *) vec_o_reserve (NULL, -alloc_, = offsetof (VEC(T),vec), sizeof (T)); } s= tatic inline VEC(T) *VEC_OP (T,copy) (VEC(T) *vec_) { size_= t len_ =3D vec_ ? vec_->num : 0; VEC (T) *new_vec_ =3D NULL; = if (len_) { new_vec_ = =3D (VEC (T) *) vec_o_reserve (NULL, -len_, offsetof (VEC(T),vec), = sizeof (T)); new_vec_->num =3D len_; memcpy= (new_vec_->vec, vec_->vec, sizeof (T) * len_); } return= new_vec_; } static inline void VEC_OP (T,free= ) (VEC(T) **vec_) { if (*vec_) = vec_free_ (*vec_); *vec_ =3D NULL; } = static inline void VEC_OP (T,cleanup) (void *arg_) { = VEC(T) **vec_ =3D arg_; if (*vec_) vec_fr= ee_ (*vec_); *vec_ =3D NULL; } stat= ic inline int VEC_OP (T,reserve) (VEC(T) **vec_, int alloc_ VEC_= ASSERT_DECL) { int extend =3D !VEC_OP (T,space) (*ve= c_, alloc_ < 0 ? -alloc_ : alloc_ VEC_ASSERT_PASS); if (ext= end) *vec_ =3D (VEC(T) *) vec_o_reserve (*vec_, alloc_, = offsetof (VEC(T),vec), sizeof (T)); return extend; = } static inline void VEC_OP (T,safe_grow) = (VEC(T) **vec_, int size_ VEC_ASSERT_DECL) { vec_asser= t (size_ >=3D 0 && VEC_OP(T,length) (*vec_) <=3D (unsigned)size_, '); = VEC_OP (T,reserve) (vec_, (int)(*vec_ ? (*vec_)->num : 0) - size_ = VEC_ASSERT_PASS); (*vec_)->num =3D size_; } = static inline T *VEC_OP (T,safe_push) (VEC(T) **vec_, co= nst T obj_ VEC_ASSERT_DECL) { VEC_OP (T,reserve) (vec_, 1 V= EC_ASSERT_PASS); return VEC_OP (T,quick_push) (*vec_, obj= _ VEC_ASSERT_PASS); } static inline T *VEC_OP (T,sa= fe_insert) (VEC(T) **vec_, unsigned ix_, const T obj_ VEC_ASSERT= _DECL) { VEC_OP (T,reserve) (vec_, 1 VEC_ASSERT_PASS); = return VEC_OP (T,quick_insert) (*vec_, ix_, obj_ VEC_ASSERT_PAS= S); } > gdb/common/vec.h:703: code: inline: Do not use the inline attribute; sinc= e the compiler generally ignores this, better algorithm selection is needed= to improved performance gdb/common/vec.h:703:#define DEF_VEC_FUNC_P(T) static inline unsigne= d VEC_OP (T,length) (const VEC(T) *vec_) { return vec_ ? vec= _->num : 0; } static inline T VEC_OP (T,last) = (const VEC(T) *vec_ VEC_ASSERT_DECL) { vec_assert (= vec_ && vec_->num, '); return vec_->vec[vec_->num - 1]; = } static inline T VEC_OP (T,index) (co= nst VEC(T) *vec_, unsigned ix_ VEC_ASSERT_DECL) { vec_asser= t (vec_ && ix_ < vec_->num, '); return vec_->vec[ix_]; = } static inline int VEC_OP (T,iterate) = (const VEC(T) *vec_, unsigned ix_, T *ptr) { if (vec_ && i= x_ < vec_->num) { *ptr =3D vec_->vec[ix_]; = return 1; } else { = *ptr =3D 0; return 0; } } = static inline size_t VEC_OP (T,embedded_size) (i= nt alloc_) { return offsetof (VEC(T),vec) + alloc_ * si= zeof(T); } static inline void VEC_OP (T,embedded_i= nit) (VEC(T) *vec_, int alloc_) { vec_->num = =3D 0; vec_->alloc =3D alloc_; } sta= tic inline int VEC_OP (T,space) (VEC(T) *vec_, int alloc_ VEC_AS= SERT_DECL) { vec_assert (alloc_ >=3D 0, '); return= vec_ ? vec_->alloc - vec_->num >=3D (unsigned)alloc_ : !alloc_; } = static inline T *VEC_OP (T,quick_push) (VEC(T) *v= ec_, T obj_ VEC_ASSERT_DECL) { T *slot_; = vec_assert (vec_->num < vec_->alloc, '); slot_ =3D &vec_->vec[ve= c_->num++]; *slot_ =3D obj_; return slot_; = } static inline T VEC_OP (T,pop) (VEC(T) *vec_ V= EC_ASSERT_DECL) { T obj_; vec_assert (= vec_->num, '); obj_ =3D vec_->vec[--vec_->num]; = return obj_; } static inline void VEC_OP (T,t= runcate) (VEC(T) *vec_, unsigned size_ VEC_ASSERT_DECL) { = vec_assert (vec_ ? vec_->num >=3D size_ : !size_, '); if (ve= c_) vec_->num =3D size_; } static= inline T VEC_OP (T,replace) (VEC(T) *vec_, unsigned ix_, T obj_= VEC_ASSERT_DECL) { T old_obj_; vec_as= sert (ix_ < vec_->num, '); old_obj_ =3D vec_->vec[ix_]; vec= _->vec[ix_] =3D obj_; return old_obj_; } = static inline T *VEC_OP (T,quick_insert) (VEC(T) *= vec_, unsigned ix_, T obj_ VEC_ASSERT_DECL) { T *slot_; = vec_assert (vec_->num < vec_->alloc && ix_ <=3D vec_->num= , '); slot_ =3D &vec_->vec[ix_]; memmove (slot_ + 1, slot_, (vec= _->num++ - ix_) * sizeof (T)); *slot_ =3D obj_; r= eturn slot_; } static inline T VEC_OP (T,orde= red_remove) (VEC(T) *vec_, unsigned ix_ VEC_ASSERT_DECL) { = T *slot_; T obj_; vec_assert (ix= _ < vec_->num, '); slot_ =3D &vec_->vec[ix_]; obj_ =3D *slot= _; memmove (slot_, slot_ + 1, (--vec_->num - ix_) * sizeof (T)); = return obj_; } static inline = T VEC_OP (T,unordered_remove) (VEC(T) *vec_, unsigned ix_ VEC_ASS= ERT_DECL) { T *slot_; T obj_; = vec_assert (ix_ < vec_->num, '); slot_ =3D &vec_->vec[ix_]; = obj_ =3D *slot_; *slot_ =3D vec_->vec[--vec_->num]; = return obj_; } static inline void V= EC_OP (T,block_remove) (VEC(T) *vec_, unsigned ix_, unsigned len_= VEC_ASSERT_DECL) { T *slot_; vec_asser= t (ix_ + len_ <=3D vec_->num, '); slot_ =3D &vec_->vec[ix_]; = vec_->num -=3D len_; memmove (slot_, slot_ + len_, (vec_->num - = ix_) * sizeof (T)); } static inline T *VEC_OP (T,add= ress) (VEC(T) *vec_) { return vec_ ? vec_->v= ec : 0; } static inline unsigned VEC_OP (T,lowe= r_bound) (VEC(T) *vec_, const T obj_, int (*lessthan_= )(const T, const T) VEC_ASSERT_DECL) { unsigned int len_ = =3D VEC_OP (T, length) (vec_); unsigned int half_, middle_; = unsigned int first_ =3D 0; while (len_ > 0) { = T middle_elem_; half_ =3D len_ >> 1; = middle_ =3D first_; middle_ +=3D half_; = middle_elem_ =3D VEC_OP (T,index) (vec_, middle_ VEC_ASSERT_PASS); = if (lessthan_ (middle_elem_, obj_)) { = first_ =3D middle_; ++first_; l= en_ =3D len_ - half_ - 1; } else = len_ =3D half_; } return first_; = } > gdb/common/vec.h:782: code: inline: Do not use the inline attribute; sinc= e the compiler generally ignores this, better algorithm selection is needed= to improved performance gdb/common/vec.h:782:#define DEF_VEC_ALLOC_FUNC_P(T) static inline V= EC(T) *VEC_OP (T,alloc) (int alloc_) { = return (VEC(T) *) vec_p_reserve (NULL, -alloc_); } = static inline void VEC_OP (T,free) (VEC(T) **vec_) { = if (*vec_) vec_free_ (*vec_); *vec_ =3D N= ULL; } static inline void VEC_OP (T,cleanup) = (void *arg_) { VEC(T) **vec_ =3D arg_; = if (*vec_) vec_free_ (*vec_); *vec_ =3D NULL; = } static inline VEC(T) *VEC_OP (T,copy) (VEC(T= ) *vec_) { size_t len_ =3D vec_ ? vec_->num : 0; VE= C (T) *new_vec_ =3D NULL; if (len_) { = new_vec_ =3D (VEC (T) *)(vec_p_reserve (NULL, -len_))= ; new_vec_->num =3D len_; memcpy (new_vec_= ->vec, vec_->vec, sizeof (T) * len_); } return new_vec_;= } static inline int VEC_OP (T,reserve) = (VEC(T) **vec_, int alloc_ VEC_ASSERT_DECL) { int exte= nd =3D !VEC_OP (T,space) (*vec_, alloc_ < 0 ? -alloc_ : alloc_ VEC_A= SSERT_PASS); if (extend) *vec_ =3D (VEC(T) *) = vec_p_reserve (*vec_, alloc_); return extend; } = static inline void VEC_OP (T,safe_grow) (VEC(= T) **vec_, int size_ VEC_ASSERT_DECL) { vec_assert (size_ = >=3D 0 && VEC_OP(T,length) (*vec_) <=3D (unsigned)size_, '); VE= C_OP (T,reserve) (vec_, (int)(*vec_ ? (*vec_)->num : 0) - size_ VE= C_ASSERT_PASS); (*vec_)->num =3D size_; } s= tatic inline T *VEC_OP (T,safe_push) (VEC(T) **vec_, T obj_ VEC_= ASSERT_DECL) { VEC_OP (T,reserve) (vec_, 1 VEC_ASSERT_PASS= ); return VEC_OP (T,quick_push) (*vec_, obj_ VEC_ASSERT_P= ASS); } static inline T *VEC_OP (T,safe_insert) = (VEC(T) **vec_, unsigned ix_, T obj_ VEC_ASSERT_DECL) { = VEC_OP (T,reserve) (vec_, 1 VEC_ASSERT_PASS); return = VEC_OP (T,quick_insert) (*vec_, ix_, obj_ VEC_ASSERT_PASS); } > gdb/common/vec.h:952: code: inline: Do not use the inline attribute; sinc= e the compiler generally ignores this, better algorithm selection is needed= to improved performance gdb/common/vec.h:952:#define DEF_VEC_FUNC_O(T) static inline unsigne= d VEC_OP (T,length) (const VEC(T) *vec_) { return vec_ ? vec= _->num : 0; } static inline T *VEC_OP (T,last) = (VEC(T) *vec_ VEC_ASSERT_DECL) { vec_assert (vec_ && vec_->n= um, '); return &vec_->vec[vec_->num - 1]; } = static inline T *VEC_OP (T,index) (VEC(T) *vec_, u= nsigned ix_ VEC_ASSERT_DECL) { vec_assert (vec_ && ix_ < ve= c_->num, '); return &vec_->vec[ix_]; } = static inline int VEC_OP (T,iterate) (VEC(T) *vec_, uns= igned ix_, T **ptr) { if (vec_ && ix_ < vec_->num) = { *ptr =3D &vec_->vec[ix_]; return 1; = } else { *ptr =3D 0; = return 0; } } stati= c inline size_t VEC_OP (T,embedded_size) (int alloc_) { = return offsetof (VEC(T),vec) + alloc_ * sizeof(T); } = static inline void VEC_OP (T,embedded_init) (VEC(T)= *vec_, int alloc_) { vec_->num =3D 0; vec_->a= lloc =3D alloc_; } static inline int VEC_OP (T= ,space) (VEC(T) *vec_, int alloc_ VEC_ASSERT_DECL) { = vec_assert (alloc_ >=3D 0, '); return vec_ ? vec_->alloc - ve= c_->num >=3D (unsigned)alloc_ : !alloc_; } static in= line T *VEC_OP (T,quick_push) (VEC(T) *vec_, const T *obj_ VEC_A= SSERT_DECL) { T *slot_; vec_assert (v= ec_->num < vec_->alloc, '); slot_ =3D &vec_->vec[vec_->num++]; = if (obj_) *slot_ =3D *obj_; return slot= _; } static inline void VEC_OP (T,pop) (VEC(T= ) *vec_ VEC_ASSERT_DECL) { vec_assert (vec_->num, '); = --vec_->num; } static inline void VEC_OP (T,= truncate) (VEC(T) *vec_, unsigned size_ VEC_ASSERT_DECL) { = vec_assert (vec_ ? vec_->num >=3D size_ : !size_, '); if (v= ec_) vec_->num =3D size_; } stati= c inline T *VEC_OP (T,replace) (VEC(T) *vec_, unsigned ix_, cons= t T *obj_ VEC_ASSERT_DECL) { T *slot_; = vec_assert (ix_ < vec_->num, '); slot_ =3D &vec_->vec[ix_]; = if (obj_) *slot_ =3D *obj_; return slot_= ; } static inline T *VEC_OP (T,quick_insert) = (VEC(T) *vec_, unsigned ix_, const T *obj_ VEC_ASSERT_DECL) { = T *slot_; vec_assert (vec_->num < vec_->al= loc && ix_ <=3D vec_->num, '); slot_ =3D &vec_->vec[ix_]; memmov= e (slot_ + 1, slot_, (vec_->num++ - ix_) * sizeof (T)); if (obj_) = *slot_ =3D *obj_; return slot_; } = static inline void VEC_OP (T,ordered_remove) (= VEC(T) *vec_, unsigned ix_ VEC_ASSERT_DECL) { T *slot_; = vec_assert (ix_ < vec_->num, '); slot_ =3D &vec_->= vec[ix_]; memmove (slot_, slot_ + 1, (--vec_->num - ix_) * sizeof = (T)); } static inline void VEC_OP (T,unordered_remo= ve) (VEC(T) *vec_, unsigned ix_ VEC_ASSERT_DECL) { = vec_assert (ix_ < vec_->num, '); vec_->vec[ix_] =3D vec_->vec[--vec= _->num]; } static inline void VEC_OP (T,block_rem= ove) (VEC(T) *vec_, unsigned ix_, unsigned len_ VEC_ASSERT_DECL) = { T *slot_; vec_assert (ix_ + len_ <=3D= vec_->num, '); slot_ =3D &vec_->vec[ix_]; vec_->num -=3D le= n_; memmove (slot_, slot_ + len_, (vec_->num - ix_) * sizeof (T))= ; } static inline T *VEC_OP (T,address) (= VEC(T) *vec_) { return vec_ ? vec_->vec : 0; } = static inline unsigned VEC_OP (T,lower_bound) = (VEC(T) *vec_, const T *obj_, int (*lessthan_)(const T *, cons= t T *) VEC_ASSERT_DECL) { unsigned int len_ =3D VEC_OP (T, = length) (vec_); unsigned int half_, middle_; unsigned int = first_ =3D 0; while (len_ > 0) { T= *middle_elem_; half_ =3D len_ >> 1; middle_ = =3D first_; middle_ +=3D half_; middle_elem_ = =3D VEC_OP (T,index) (vec_, middle_ VEC_ASSERT_PASS); if (lessthan= _ (middle_elem_, obj_)) { first_ =3D m= iddle_; ++first_; len_ =3D len_ - = half_ - 1; } else len_ = =3D half_; } return first_; } > gdb/common/vec.h:1034: code: inline: Do not use the inline attribute; sin= ce the compiler generally ignores this, better algorithm selection is neede= d to improved performance gdb/common/vec.h:1034:#define DEF_VEC_ALLOC_FUNC_O(T) static inline = VEC(T) *VEC_OP (T,alloc) (int alloc_) { = return (VEC(T) *) vec_o_reserve (NULL, -alloc_, = offsetof (VEC(T),vec), sizeof (T)); } = static inline VEC(T) *VEC_OP (T,copy) (VEC(T) *vec_) { size= _t len_ =3D vec_ ? vec_->num : 0; VEC (T) *new_vec_ =3D NULL; = if (len_) { new_vec_ = =3D (VEC (T) *) vec_o_reserve (NULL, -len_, offsetof (VEC(T),vec),= sizeof (T)); new_vec_->num =3D len_; memcpy= (new_vec_->vec, vec_->vec, sizeof (T) * len_); } return= new_vec_; } static inline void VEC_OP (T,free= ) (VEC(T) **vec_) { if (*vec_) = vec_free_ (*vec_); *vec_ =3D NULL; } = static inline void VEC_OP (T,cleanup) (void *arg_) { = VEC(T) **vec_ =3D arg_; if (*vec_) vec_fr= ee_ (*vec_); *vec_ =3D NULL; } stat= ic inline int VEC_OP (T,reserve) (VEC(T) **vec_, int alloc_ VEC_= ASSERT_DECL) { int extend =3D !VEC_OP (T,space) (*vec_, all= oc_ < 0 ? -alloc_ : alloc_ VEC_ASSERT_PASS); if (e= xtend) *vec_ =3D (VEC(T) *) vec_o_reserve (*vec_, all= oc_, offsetof (VEC(T),vec), sizeof (T)); return extend; = } static inline void VEC_OP (T,safe_grow) = (VEC(T) **vec_, int size_ VEC_ASSERT_DECL) { vec_assert (= size_ >=3D 0 && VEC_OP(T,length) (*vec_) <=3D (unsigned)size_, '); = VEC_OP (T,reserve) (vec_, (int)(*vec_ ? (*vec_)->num : 0) - si= ze_ VEC_ASSERT_PASS); (*vec_)->num =3D size_; } = static inline T *VEC_OP (T,safe_push) (VEC(T) **vec_, const= T *obj_ VEC_ASSERT_DECL) { VEC_OP (T,reserve) (vec_, 1 VEC= _ASSERT_PASS); return VEC_OP (T,quick_push) (*vec_, obj_ = VEC_ASSERT_PASS); } static inline T *VEC_OP (T,safe= _insert) (VEC(T) **vec_, unsigned ix_, const T *obj_ VEC_ASSERT_= DECL) { VEC_OP (T,reserve) (vec_, 1 VEC_ASSERT_PASS); = return VEC_OP (T,quick_insert) (*vec_, ix_, obj_ VEC_ASSERT_PASS= ); } 1033,1040d1040 < gdb/vec.c:34: code: inline: Do not use the inline attribute; since the co= mpiler generally ignores this, better algorithm selection is needed to impr= oved performance gdb/vec.c:34:static inline unsigned < gdb/vec.h:416: code: inline: Do not use the inline attribute; since the c= ompiler generally ignores this, better algorithm selection is needed to imp= roved performance gdb/vec.h:416:#define DEF_VEC_I(T) static inline void VEC_OP (T,mus= t_be_integral_type) (void) { (void)~(T)0; } = VEC_T(T); DEF_VEC_FUNC_P(T) DEF_VEC_ALLOC_FU= NC_I(T) struct vec_swallow_trailing_semi < gdb/vec.h:428: code: inline: Do not use the inline attribute; since the c= ompiler generally ignores this, better algorithm selection is needed to imp= roved performance gdb/vec.h:428:#define DEF_VEC_P(T) static inline void VEC_OP (T,mus= t_be_pointer_type) (void) { (void)((T)1 =3D=3D (void *)1); = } VEC_T(T); DEF_VEC_FUNC_P(T) D= EF_VEC_ALLOC_FUNC_P(T) struct vec_swallow_trailing_semi < gdb/vec.h:517: code: inline: Do not use the inline attribute; since the c= ompiler generally ignores this, better algorithm selection is needed to imp= roved performance gdb/vec.h:517:#define DEF_VEC_ALLOC_FUNC_I(T) static inline VEC(T) *= VEC_OP (T,alloc) (int alloc_) { return= (VEC(T) *) vec_o_reserve (NULL, -alloc_, = offsetof (VEC(T),vec), sizeof (T)); } static i= nline VEC(T) *VEC_OP (T,copy) (VEC(T) *vec_) { size_t len_ = =3D vec_ ? vec_->num : 0; VEC (T) *new_vec_ =3D NULL; = if (len_) { new_vec_ =3D (VEC= (T) *) vec_o_reserve (NULL, -len_, offsetof (VEC(T),vec), sizeof (= T)); new_vec_->num =3D len_; memcpy (new_ve= c_->vec, vec_->vec, sizeof (T) * len_); } return new_vec= _; } static inline void VEC_OP (T,free) = (VEC(T) **vec_) { if (*vec_) vec_free= _ (*vec_); *vec_ =3D NULL; } static= inline void VEC_OP (T,cleanup) (void *arg_) { = VEC(T) **vec_ =3D arg_; if (*vec_) vec_free_ (*ve= c_); *vec_ =3D NULL; } static inlin= e int VEC_OP (T,reserve) (VEC(T) **vec_, int alloc_ VEC_ASSERT_D= ECL) { int extend =3D !VEC_OP (T,space) (*vec_, allo= c_ < 0 ? -alloc_ : alloc_ VEC_ASSERT_PASS); if (extend) = *vec_ =3D (VEC(T) *) vec_o_reserve (*vec_, alloc_, = offsetof (VEC(T),vec), sizeof (T)); return extend; } = static inline void VEC_OP (T,safe_grow) (VEC= (T) **vec_, int size_ VEC_ASSERT_DECL) { vec_assert (size_= >=3D 0 && VEC_OP(T,length) (*vec_) <=3D (unsigned)size_, '); V= EC_OP (T,reserve) (vec_, (int)(*vec_ ? (*vec_)->num : 0) - size_ VEC_A= SSERT_PASS); (*vec_)->num =3D size_; } = static inline T *VEC_OP (T,safe_push) (VEC(T) **vec_, const T ob= j_ VEC_ASSERT_DECL) { VEC_OP (T,reserve) (vec_, 1 VEC_ASSER= T_PASS); return VEC_OP (T,quick_push) (*vec_, obj_ VEC_AS= SERT_PASS); } static inline T *VEC_OP (T,safe_inser= t) (VEC(T) **vec_, unsigned ix_, const T obj_ VEC_ASSERT_DECL) = { VEC_OP (T,reserve) (vec_, 1 VEC_ASSERT_PASS); = return VEC_OP (T,quick_insert) (*vec_, ix_, obj_ VEC_ASSERT_PASS); } < gdb/vec.h:700: code: inline: Do not use the inline attribute; since the c= ompiler generally ignores this, better algorithm selection is needed to imp= roved performance gdb/vec.h:700:#define DEF_VEC_FUNC_P(T) static inline unsigned VEC_O= P (T,length) (const VEC(T) *vec_) { return vec_ ? vec_->num = : 0; } static inline T VEC_OP (T,last) = (const VEC(T) *vec_ VEC_ASSERT_DECL) { vec_assert (vec_ &&= vec_->num, '); return vec_->vec[vec_->num - 1]; } = static inline T VEC_OP (T,index) (const VEC= (T) *vec_, unsigned ix_ VEC_ASSERT_DECL) { vec_assert (vec_= && ix_ < vec_->num, '); return vec_->vec[ix_]; } = static inline int VEC_OP (T,iterate) (const = VEC(T) *vec_, unsigned ix_, T *ptr) { if (vec_ && ix_ < ve= c_->num) { *ptr =3D vec_->vec[ix_]; = return 1; } else { = *ptr =3D 0; return 0; } } = static inline size_t VEC_OP (T,embedded_size) (int allo= c_) { return offsetof (VEC(T),vec) + alloc_ * sizeof(T)= ; } static inline void VEC_OP (T,embedded_init) = (VEC(T) *vec_, int alloc_) { vec_->num =3D 0; = vec_->alloc =3D alloc_; } static inlin= e int VEC_OP (T,space) (VEC(T) *vec_, int alloc_ VEC_ASSERT_DECL= ) { vec_assert (alloc_ >=3D 0, '); return vec_ ? v= ec_->alloc - vec_->num >=3D (unsigned)alloc_ : !alloc_; } = static inline T *VEC_OP (T,quick_push) (VEC(T) *vec_, T ob= j_ VEC_ASSERT_DECL) { T *slot_; vec_= assert (vec_->num < vec_->alloc, '); slot_ =3D &vec_->vec[vec_->num++= ]; *slot_ =3D obj_; return slot_; } = static inline T VEC_OP (T,pop) (VEC(T) *vec_ VEC_ASSERT= _DECL) { T obj_; vec_assert (vec_->num= , '); obj_ =3D vec_->vec[--vec_->num]; return ob= j_; } static inline void VEC_OP (T,truncate) = (VEC(T) *vec_, unsigned size_ VEC_ASSERT_DECL) { = vec_assert (vec_ ? vec_->num >=3D size_ : !size_, '); if (vec_) = vec_->num =3D size_; } static inline T= VEC_OP (T,replace) (VEC(T) *vec_, unsigned ix_, T obj_ VEC_ASSE= RT_DECL) { T old_obj_; vec_assert (ix_= < vec_->num, '); old_obj_ =3D vec_->vec[ix_]; vec_->vec[ix= _] =3D obj_; return old_obj_; } = static inline T *VEC_OP (T,quick_insert) (VEC(T) *vec_, uns= igned ix_, T obj_ VEC_ASSERT_DECL) { T *slot_; = vec_assert (vec_->num < vec_->alloc && ix_ <=3D vec_->num, '); s= lot_ =3D &vec_->vec[ix_]; memmove (slot_ + 1, slot_, (vec_->num++ = - ix_) * sizeof (T)); *slot_ =3D obj_; return slo= t_; } static inline T VEC_OP (T,ordered_remov= e) (VEC(T) *vec_, unsigned ix_ VEC_ASSERT_DECL) { = T *slot_; T obj_; vec_assert (ix_ < vec_-= >num, '); slot_ =3D &vec_->vec[ix_]; obj_ =3D *slot_; = memmove (slot_, slot_ + 1, (--vec_->num - ix_) * sizeof (T)); = return obj_; } static inline T VEC_OP = (T,unordered_remove) (VEC(T) *vec_, unsigned ix_ VEC_ASSERT_DECL)= { T *slot_; T obj_; vec_a= ssert (ix_ < vec_->num, '); slot_ =3D &vec_->vec[ix_]; obj_ = =3D *slot_; *slot_ =3D vec_->vec[--vec_->num]; = return obj_; } static inline void VEC_OP (T,= block_remove) (VEC(T) *vec_, unsigned ix_, unsigned len_ VEC_ASSE= RT_DECL) { T *slot_; vec_assert (ix_ + = len_ <=3D vec_->num, '); slot_ =3D &vec_->vec[ix_]; vec_->nu= m -=3D len_; memmove (slot_, slot_ + len_, (vec_->num - ix_) * si= zeof (T)); } static inline T *VEC_OP (T,address) = (VEC(T) *vec_) { return vec_ ? vec_->vec : 0; = } static inline unsigned VEC_OP (T,lower_bound) = (VEC(T) *vec_, const T obj_, int (*lessthan_)(const T= , const T) VEC_ASSERT_DECL) { unsigned int len_ =3D VEC_OP = (T, length) (vec_); unsigned int half_, middle_; unsigned = int first_ =3D 0; while (len_ > 0) { = T middle_elem_; half_ =3D len_ >> 1; midd= le_ =3D first_; middle_ +=3D half_; middle_el= em_ =3D VEC_OP (T,index) (vec_, middle_ VEC_ASSERT_PASS); if (less= than_ (middle_elem_, obj_)) { first_ = =3D middle_; ++first_; len_ =3D le= n_ - half_ - 1; } else = len_ =3D half_; } return first_; } < gdb/vec.h:779: code: inline: Do not use the inline attribute; since the c= ompiler generally ignores this, better algorithm selection is needed to imp= roved performance gdb/vec.h:779:#define DEF_VEC_ALLOC_FUNC_P(T) static inline VEC(T) *= VEC_OP (T,alloc) (int alloc_) { return= (VEC(T) *) vec_p_reserve (NULL, -alloc_); } stati= c inline void VEC_OP (T,free) (VEC(T) **vec_) { = if (*vec_) vec_free_ (*vec_); *vec_ =3D NULL; = } static inline void VEC_OP (T,cleanup) = (void *arg_) { VEC(T) **vec_ =3D arg_; if= (*vec_) vec_free_ (*vec_); *vec_ =3D NULL; = } static inline VEC(T) *VEC_OP (T,copy) (VEC(T) *vec_= ) { size_t len_ =3D vec_ ? vec_->num : 0; VEC (T) *= new_vec_ =3D NULL; if (len_) { = new_vec_ =3D (VEC (T) *)(vec_p_reserve (NULL, -len_)); = new_vec_->num =3D len_; memcpy (new_vec_->vec, = vec_->vec, sizeof (T) * len_); } return new_vec_; = } static inline int VEC_OP (T,reserve) (V= EC(T) **vec_, int alloc_ VEC_ASSERT_DECL) { int extend =3D = !VEC_OP (T,space) (*vec_, alloc_ < 0 ? -alloc_ : alloc_ VEC_ASSERT_P= ASS); if (extend) *vec_ =3D (VEC(T) *) vec_p_r= eserve (*vec_, alloc_); return extend; } = static inline void VEC_OP (T,safe_grow) (VEC(T) **ve= c_, int size_ VEC_ASSERT_DECL) { vec_assert (size_ >=3D 0 = && VEC_OP(T,length) (*vec_) <=3D (unsigned)size_, '); VEC_OP (T= ,reserve) (vec_, (int)(*vec_ ? (*vec_)->num : 0) - size_ VEC_ASSER= T_PASS); (*vec_)->num =3D size_; } static i= nline T *VEC_OP (T,safe_push) (VEC(T) **vec_, T obj_ VEC_ASSERT_= DECL) { VEC_OP (T,reserve) (vec_, 1 VEC_ASSERT_PASS); = return VEC_OP (T,quick_push) (*vec_, obj_ VEC_ASSERT_PASS); = } static inline T *VEC_OP (T,safe_insert) = (VEC(T) **vec_, unsigned ix_, T obj_ VEC_ASSERT_DECL) { VEC= _OP (T,reserve) (vec_, 1 VEC_ASSERT_PASS); return VEC_OP = (T,quick_insert) (*vec_, ix_, obj_ VEC_ASSERT_PASS); } < gdb/vec.h:949: code: inline: Do not use the inline attribute; since the c= ompiler generally ignores this, better algorithm selection is needed to imp= roved performance gdb/vec.h:949:#define DEF_VEC_FUNC_O(T) static inline unsigned VEC_O= P (T,length) (const VEC(T) *vec_) { return vec_ ? vec_->num = : 0; } static inline T *VEC_OP (T,last) (VEC(T)= *vec_ VEC_ASSERT_DECL) { vec_assert (vec_ && vec_->num, ');= return &vec_->vec[vec_->num - 1]; } = static inline T *VEC_OP (T,index) (VEC(T) *vec_, unsigned= ix_ VEC_ASSERT_DECL) { vec_assert (vec_ && ix_ < vec_->num= , '); return &vec_->vec[ix_]; } = static inline int VEC_OP (T,iterate) (VEC(T) *vec_, unsigned i= x_, T **ptr) { if (vec_ && ix_ < vec_->num) { = *ptr =3D &vec_->vec[ix_]; return 1; = } else { *ptr =3D 0; = return 0; } } static inlin= e size_t VEC_OP (T,embedded_size) (int alloc_) { = return offsetof (VEC(T),vec) + alloc_ * sizeof(T); } = static inline void VEC_OP (T,embedded_init) (VEC(T) *vec_,= int alloc_) { vec_->num =3D 0; vec_->alloc = =3D alloc_; } static inline int VEC_OP (T,spac= e) (VEC(T) *vec_, int alloc_ VEC_ASSERT_DECL) { = vec_assert (alloc_ >=3D 0, '); return vec_ ? vec_->alloc - vec_->n= um >=3D (unsigned)alloc_ : !alloc_; } static inline = T *VEC_OP (T,quick_push) (VEC(T) *vec_, const T *obj_ VEC_ASSERT= _DECL) { T *slot_; vec_assert (vec_->= num < vec_->alloc, '); slot_ =3D &vec_->vec[vec_->num++]; if = (obj_) *slot_ =3D *obj_; return slot_; = } static inline void VEC_OP (T,pop) (VEC(T) *ve= c_ VEC_ASSERT_DECL) { vec_assert (vec_->num, '); --ve= c_->num; } static inline void VEC_OP (T,trunc= ate) (VEC(T) *vec_, unsigned size_ VEC_ASSERT_DECL) { = vec_assert (vec_ ? vec_->num >=3D size_ : !size_, '); if (vec_) = vec_->num =3D size_; } static inl= ine T *VEC_OP (T,replace) (VEC(T) *vec_, unsigned ix_, const T *= obj_ VEC_ASSERT_DECL) { T *slot_; vec_a= ssert (ix_ < vec_->num, '); slot_ =3D &vec_->vec[ix_]; if (= obj_) *slot_ =3D *obj_; return slot_; = } static inline T *VEC_OP (T,quick_insert) = (VEC(T) *vec_, unsigned ix_, const T *obj_ VEC_ASSERT_DECL) { = T *slot_; vec_assert (vec_->num < vec_->alloc &= & ix_ <=3D vec_->num, '); slot_ =3D &vec_->vec[ix_]; memmove (sl= ot_ + 1, slot_, (vec_->num++ - ix_) * sizeof (T)); if (obj_) = *slot_ =3D *obj_; return slot_; } = static inline void VEC_OP (T,ordered_remove) (VEC(T= ) *vec_, unsigned ix_ VEC_ASSERT_DECL) { T *slot_; = vec_assert (ix_ < vec_->num, '); slot_ =3D &vec_->vec[i= x_]; memmove (slot_, slot_ + 1, (--vec_->num - ix_) * sizeof (T));= } static inline void VEC_OP (T,unordered_remove) = (VEC(T) *vec_, unsigned ix_ VEC_ASSERT_DECL) { vec= _assert (ix_ < vec_->num, '); vec_->vec[ix_] =3D vec_->vec[--vec_->nu= m]; } static inline void VEC_OP (T,block_remove) = (VEC(T) *vec_, unsigned ix_, unsigned len_ VEC_ASSERT_DECL) { = T *slot_; vec_assert (ix_ + len_ <=3D vec_= ->num, '); slot_ =3D &vec_->vec[ix_]; vec_->num -=3D len_; = memmove (slot_, slot_ + len_, (vec_->num - ix_) * sizeof (T)); }= static inline T *VEC_OP (T,address) (VEC(T= ) *vec_) { return vec_ ? vec_->vec : 0; } = static inline unsigned VEC_OP (T,lower_bound) (VEC= (T) *vec_, const T *obj_, int (*lessthan_)(const T *, const T *= ) VEC_ASSERT_DECL) { unsigned int len_ =3D VEC_OP (T, lengt= h) (vec_); unsigned int half_, middle_; unsigned int first= _ =3D 0; while (len_ > 0) { T *mid= dle_elem_; half_ =3D len_ >> 1; middle_ =3D f= irst_; middle_ +=3D half_; middle_elem_ =3D V= EC_OP (T,index) (vec_, middle_ VEC_ASSERT_PASS); if (lessthan_ (mi= ddle_elem_, obj_)) { first_ =3D middle= _; ++first_; len_ =3D len_ - half_= - 1; } else len_ =3D h= alf_; } return first_; } < gdb/vec.h:1031: code: inline: Do not use the inline attribute; since the = compiler generally ignores this, better algorithm selection is needed to im= proved performance gdb/vec.h:1031:#define DEF_VEC_ALLOC_FUNC_O(T) static inline VEC(T) = *VEC_OP (T,alloc) (int alloc_) { retur= n (VEC(T) *) vec_o_reserve (NULL, -alloc_, = offsetof (VEC(T),vec), sizeof (T)); } static = inline VEC(T) *VEC_OP (T,copy) (VEC(T) *vec_) { size_t len_= =3D vec_ ? vec_->num : 0; VEC (T) *new_vec_ =3D NULL; = if (len_) { new_vec_ =3D (VE= C (T) *) vec_o_reserve (NULL, -len_, offsetof (VEC(T),vec), sizeof= (T)); new_vec_->num =3D len_; memcpy (new_v= ec_->vec, vec_->vec, sizeof (T) * len_); } return new_ve= c_; } static inline void VEC_OP (T,free) = (VEC(T) **vec_) { if (*vec_) vec_fre= e_ (*vec_); *vec_ =3D NULL; } stati= c inline void VEC_OP (T,cleanup) (void *arg_) { = VEC(T) **vec_ =3D arg_; if (*vec_) vec_free_ (*v= ec_); *vec_ =3D NULL; } static inli= ne int VEC_OP (T,reserve) (VEC(T) **vec_, int alloc_ VEC_ASSERT_= DECL) { int extend =3D !VEC_OP (T,space) (*vec_, alloc_ < 0= ? -alloc_ : alloc_ VEC_ASSERT_PASS); if (extend) = *vec_ =3D (VEC(T) *) vec_o_reserve (*vec_, alloc_, of= fsetof (VEC(T),vec), sizeof (T)); return extend; } = static inline void VEC_OP (T,safe_grow) (VEC(T= ) **vec_, int size_ VEC_ASSERT_DECL) { vec_assert (size_ >= =3D 0 && VEC_OP(T,length) (*vec_) <=3D (unsigned)size_, '); VEC= _OP (T,reserve) (vec_, (int)(*vec_ ? (*vec_)->num : 0) - size_ VEC= _ASSERT_PASS); (*vec_)->num =3D size_; } st= atic inline T *VEC_OP (T,safe_push) (VEC(T) **vec_, const T *obj= _ VEC_ASSERT_DECL) { VEC_OP (T,reserve) (vec_, 1 VEC_ASSERT= _PASS); return VEC_OP (T,quick_push) (*vec_, obj_ VEC_ASS= ERT_PASS); } static inline T *VEC_OP (T,safe_insert= ) (VEC(T) **vec_, unsigned ix_, const T *obj_ VEC_ASSERT_DECL) = { VEC_OP (T,reserve) (vec_, 1 VEC_ASSERT_PASS); = return VEC_OP (T,quick_insert) (*vec_, ix_, obj_ VEC_ASSERT_PASS); }