This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR46590
- From: Richard Biener <rguenther at suse dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 17 Jan 2014 13:14:37 +0100 (CET)
- Subject: Re: [PATCH] Fix PR46590
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1401171220020 dot 4623 at zhemvz dot fhfr dot qr> <20140117114133 dot GC892 at tucnak dot redhat dot com>
On Fri, 17 Jan 2014, Jakub Jelinek wrote:
> On Fri, Jan 17, 2014 at 12:32:34PM +0100, Richard Biener wrote:
> > ! /* Search the contents of the sorted vector with a binary search.
> > ! CMP is the comparison function to pass to bsearch. */
>
> Can you please sed -i -e s/__//g in the whole method?
> I mean, this isn't in libstdc++ or glibc header, so there is no point
> in obfuscating the names, and the __ prefixed names are even reserved
> for implementation, which we are not at least in stage1 built compiler.
Will do.
Richard.
> > ! template<typename T, typename A>
> > ! inline T *
> > ! vec<T, A, vl_embed>::bsearch (const void *__key,
> > ! int (*__compar) (const void *, const void *))
> > ! {
> > ! const void *__base = this->address ();
> > ! size_t __nmemb = this->length ();
> > ! size_t __size = sizeof (T);
> > ! /* The following is a copy of glibc stdlib-bsearch.h. */
> > ! size_t __l, __u, __idx;
> > ! const void *__p;
> > ! int __comparison;
> > !
> > ! __l = 0;
> > ! __u = __nmemb;
> > ! while (__l < __u)
> > ! {
> > ! __idx = (__l + __u) / 2;
> > ! __p = (const void *) (((const char *) __base) + (__idx * __size));
> > ! __comparison = (*__compar) (__key, __p);
> > ! if (__comparison < 0)
> > ! __u = __idx;
> > ! else if (__comparison > 0)
> > ! __l = __idx + 1;
> > ! else
> > ! return (T *)const_cast<void *>(__p);
> > ! }
> > !
> > ! return NULL;
> > }
k