This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR46590
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 17 Jan 2014 12:41:33 +0100
- 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>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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.
> ! 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;
> }
Jakub