------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-16 14:11 ------- We look much better now but still little problems: bool f(const std::vector<bool, std::allocator<bool> >&, size_t) (v, x) { ptrdiff_t __n.82; unsigned int SR.77; _Bit_type * __x; ptrdiff_t __n; struct _Bit_iterator & __x;
<bb 0>: __x = &v->D.10279._M_impl._M_start; //<--this could be pushed into the next two instructions __n = (ptrdiff_t) (__x->D.8752._M_offset + (unsigned int) (ptrdiff_t) x); __x = __x->D.8752._M_p + (_Bit_type *) ((unsigned int) (__n / 32) * 4); __n.82 = __n % 32; if (__n.82 < 0) goto <L1>; else goto <L2>; //<-- could be done based on __n instead of __n.82 <L1>:; SR.77 = (unsigned int) (__n.82 + 32); __x = __x - 4B; goto <bb 3> (<L3>); <L2>:; SR.77 = (unsigned int) __n.82; <L3>:; return (int) (bool) (int) (bool) (int) (bool) ((1 << (int) SR.77 & *__x) != 0); } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16611